I don't get this preoccupation with making sure addresses look valid. The ONLY way to validate an email address is to send it a message.
Perfect email regex finally found
31–40 of 118 posts
Re: Perfect email regex finally found
#32Re: Perfect email regex finally found
#33How ugly do non-regex based email validation functions look? I've never seen one, but I've always wondered if that was a more elegant solution.
One nice looking trick I've seen is checking the domain of the email address for an MX record. (e.g. http://php.dzone.com/news/php-email-validator-email-mx-d ) Possibly this approach is too slow to use by itself without a regex. Also maybe there are other problems with this method I'm not aware of?
Re: Perfect email regex finally found
#34Re: Perfect email regex finally found
#35Earlier quoted context omitted.
Especially when the spec itself is in EBNF.
True, though it's EBNF with a bunch of explanatory text and annotations. What would be interesting, but I can't find with some googling: Has someone implemented a parser-generator based on the spec? The ideal would be that the parser specification looks a lot like the RFC, since then you'd have more confidence it was actually correct (and it'd be easier to maintain for future changes).
Re: Perfect email regex finally found
#36Re: Perfect email regex finally found
#37I've accepted that it's best to treat people like grown-ups and if there's '@' and '.' and it's retyped then it passes. Someone can easily submit a fake name or phone number or street address, and e-mail's no different. If they get it wrong, intentionally or not, then they don't get their receipt, confirmation, validation link, etc. and I believe in most cases the incentive is there for them to get it right. In the r…
Retyping only makes sense for password field, which is obfuscated and doesn't allow copy&paste.
Re: Perfect email regex finally found
#38Sometimes, you aren't validating a whole string, you are searching for email addresses in a sea of text, or an arbitrarily delimited, user-entered list of contacts.
Support usernames with alphanumerics, dashes, underscores, periods, and plus signs; Require a single @; Support domains with alphanumerics, dashes, and at least one period. Screw anyone with something more complex than that. Done deal.
Re: Perfect email regex finally found
#39I've accepted that it's best to treat people like grown-ups and if there's '@' and '.' and it's retyped then it passes. Someone can easily submit a fake name or phone number or street address, and e-mail's no different. If they get it wrong, intentionally or not, then they don't get their receipt, confirmation, validation link, etc. and I believe in most cases the incentive is there for them to get it right. In the r…
1) Send an email to the address.
2) If it succeeds, the address was valid.
Re: Perfect email regex finally found
#40I've accepted that it's best to treat people like grown-ups and if there's '@' and '.' and it's retyped then it passes. Someone can easily submit a fake name or phone number or street address, and e-mail's no different. If they get it wrong, intentionally or not, then they don't get their receipt, confirmation, validation link, etc. and I believe in most cases the incentive is there for them to get it right. In the r…
BTW, the email address that doesn't work is "jon-whatever@jrock.us". The .us confuses people and the - confuses people. WTF!?