News for hackers. Stuff that matters.
Re:You Suck (On web apps that mismanage text) by tlb on Friday March 19, 2010 @12:53PM (#1204542)
The problem is that the actual spec for validating email addresses is preposterously long and complex, and can't even be implemented as a regexp since it requires nested parsing. So everyone just writes /^\w+@\w+\.[\.\w]+$/ or something lame.
Re:You Suck (On web apps that mismanage text) by ominous_prime on Friday March 19, 2010 @01:09PM (#1204585)
No, the problem is people trying to validate email addresses when they shouldn't. Similar to the credit card name example in TFA, you're trying to save a call to the MTA, when in reality, a user that doesn't want to be contacted will enter [email protected], and you have to send it anyway.
Re:You Suck (On web apps that mismanage text) by Confusion on Friday March 19, 2010 @03:28PM (#1205023)
You want to validate email addresses, because a surprising number of users is incapable of typing their email address correctly in one try. Validation saves a lot of rework.
Re:You Suck (On web apps that mismanage text) by ars on Friday March 19, 2010 @06:01PM (#1205397)
What I do is validate and warn if it looks bad, but not prevent.
Re:You Suck (On web apps that mismanage text) by blasdel on Friday March 19, 2010 @09:03PM (#1205732)
The 'spec' for validating an email address is to send mail containing a token to it and require the user to respond with it.

Bang paths are valid but aren't going to be routable these days. Different hosts allow different characters in usernames, and have different meta-replacement rules for stuff like periods and pluses.

You don't validate a domain name with a regex, you use a goddamn DNS resolver. Email addresses are a superset of that! Don't use a fucking regex.

Re:You Suck (On web apps that mismanage text) by bruceboughton on Friday March 19, 2010 @01:30PM (#1204641)
No, the problem is people trying to validate email addresses.