it is the built-in RegEx for emails, plus a clause allowing for an optional comma "([,])*". I also wrapped the whole thing on "(...)*" to allow for multiple occurrences.
Next thing I will do is make sure only once comma is accept4d instead of the "zero or many" criteria of "*", and will also (try to) find a way to not having a comma at the end without a valid email after it.
I've seen other characters on the LHS as well... & jumps out at me, but there are likely others.
The LHS of an email address isn't nearly as constrained as the RHS.
In fact, it's nearly impossible to validate e-mail addresses using a RegEx. For example, if quoted, the LHS of an e-mail address can contain literally anything.
"William, Kempf"@someserver.com is a valid e-mail address, for example. If you search Google carefully, you'll find numerous attempts, almost all fail. I've seen one example from a Perl RegEx book that claims
to be fully correct, but the RegEx is nearly a page long and totally unreadable. It's also likely to be horribly slow. If you insist on validating e-mails (I don't recommend it) then I'd suggest rolling a proper parser and not using RegEx.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.