Hacker News new | ask | show | jobs
by Intermernet 1261 days ago
Matching email addresses with any regular expression is fraught with errors. It can be done, depending on which RFC you are checking against, but in the real world it will eventually cause a problem.

You're better off using an actual parser (which will probably implement a state machine), writing a state machine yourself, or being overly accepting of invalid email addresses and just relying on attempting to deliver an email to the address.

See http://cubicspot.blogspot.com/2012/06/correct-way-to-validat... for more discussion.