4 ms·
The problem is that the RFC is amazingly permissive : almost anything goes in email adresses, including whitespace! A RFC-compliant regex is incredibly complex
by ovi256 17y ago
The problem is that the RFC is amazingly permissive : almost anything goes in email adresses, including whitespace! A RFC-compliant regex is incredibly complex [1]. Furthermore, one would need to read not one, but five RFCs in order to grok everything:
http://tools.ietf.org/html/rfc5322 http://tools.ietf.org/html/rfc5322
http://tools.ietf.org/html/rfc3696 http://tools.ietf.org/html/rfc3696
http://tools.ietf.org/html/rfc5321 http://tools.ietf.org/html/rfc5321
http://tools.ietf.org/html/rfc4291#section-2.2 http://tools.ietf.org/html/rfc4291#section-2.2
http://tools.ietf.org/html/rfc1123#section-2.1 http://tools.ietf.org/html/rfc1123#section-2.1
[1] Great overview of the problem, plus a PHP validator.
http://www.dominicsayers.com/isemail/ http://www.dominicsayers.com/isemail/