I tried to create a regular expression which catches all RFC-valid addresses but it's ok if some false-positives come through (though hopefully not so many). This is waht I came up so far:
/^\b\S+@\S+\.[^\s@]{2,}\b$/
Is there any RFC-valid address which doesn't match against this expression or do you have any suggestions to improve it? I don't mind the false positives but I would be glad if you show me a few, too.
Check out this post:
Using a regular expression to validate an email address
There is also this one:
http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
Nothing like a 6000+ character regex!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With