2 ms·
This is interesting argument in discussion about readability, usability and so on of regular expressions, but not something you want to use directly. Almost no
by dfox 18y ago
This is interesting argument in discussion about readability, usability and so on of regular expressions, but not something you want to use directly.
Almost nobody wants to validate email address according to SMTP-specified format, because almost anything is valid SMTP address and most of the formats supported by protocol specification are not usable in real world (because they does not work or does something completely unexpected...)
Moreover to use this monstrosity zou need to perform some preprocessing on the addres, because some aspects of SMTP address cannot be meaningfully expressed by regular expression. IIRC, you have to strip comments and normalize whitespace before you use this. It is probably good idea to allow comments and real names in addresses posted to some website (for example because if you paste address from some MUA, you will often get it with real name and comments), but this will not help you with that.