|
|
|
|
|
by rjbond3rd
5003 days ago
|
|
I'm not exactly disagreeing but just curious: 1. How can a non-RFC-compliant email be valid? 2. What about compiled regexes, performance-wise? 3. Sometimes a regex is faster than the overhead of a parser, so wouldn't the choice be dependent on context? In other words, regexes are not always slower, true? 4. Wouldn't some abstraction libraries utilize regexes under the hood? Would that be wrong in your view? P.S. Some languages allow the option for very readable regexes, e.g. separate each component on its own line, with a comment. |
|
甲斐@黒川.日本 is a non-RFC 5322-compliant, but still valid, email address.
Unless you're implying that "valid" === RFC 5322-compliant, in which case the example isn't valid ;)
The best way to validate an email address: send an email to that email address containing a confirmation link. Simple, easy.