Comment on Stop validating email addresses with your complex regexparentComments−eli14yI totally agree. The one other thing I might add is to check for commas, since they are never valid in an email address and "something,com" is a common typo.−ken14yBy my reading of RFC 822, commas are technically valid, as long as they are properly quoted, as in: "Doe, John"@example.comOf course, whether any email server actually accepts that is a different story.−eli14yAt the risk of sounding like a hyprocrite since I just advocated for minimal validation of emails... that is a nonissue. Nobody actually does that.Anyway, the regexp I use is /.+@.+\..+/ which supports the address you describe, but (usually) catches the relatively common mistake of user@yahoo,com−jph14yCommas can be valid and our servers manage them correctly.
Comments
I totally agree. The one other thing I might add is to check for commas, since they are never valid in an email address and "something,com" is a common typo.
By my reading of RFC 822, commas are technically valid, as long as they are properly quoted, as in: "Doe, John"@example.com
Of course, whether any email server actually accepts that is a different story.
At the risk of sounding like a hyprocrite since I just advocated for minimal validation of emails... that is a nonissue. Nobody actually does that.
Anyway, the regexp I use is /.+@.+\..+/ which supports the address you describe, but (usually) catches the relatively common mistake of user@yahoo,com
Commas can be valid and our servers manage them correctly.