For now I'm using this regexp:
^\A([a-z0-9\.\-_\+]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z$
I think it is not very good. So what's the best regular expression you have or have seen for validating jids?
For reference, Section 3 of the XMPP core standard defines a JID in Augmented Backus-Naur Form as
jid = [ node "@" ] domain [ "/" resource ]
domain = fqdn / address-literal
fqdn = (sub-domain 1*("." sub-domain))
sub-domain = (internationalized domain label)
address-literal = IPv4address / IPv6address