News for hackers. Stuff that matters.
Re:HTML5 Features you need to know by ancarda on Saturday May 25, 2013 @04:14PM (#5768669)
I should point out it's generally not a good idea to try to use regex on an email address. It's surprisingly complex and very easy to miss something. I'd rely on type="email" and send a verification link server-side.
Re:HTML5 Features you need to know by callahad on Saturday May 25, 2013 @04:34PM (#5768714)
What out the WHATWG's take on it: http://www.whatwg.org/specs/web-apps/current-work/multipage/...

Specifically, they've redefined the format of email addresses in a way that's much simpler and is actually amenable to regular expressions. "This requirement is a willful violation of RFC 5322, which defines a syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here."

The spec even includes a Perl-compatible regex as an example. :)

Re:HTML5 Features you need to know by callahad on Saturday May 25, 2013 @11:13PM (#5769873)
s/What out/Check out/ # How the hell did I miss that typo? :(
Re:HTML5 Features you need to know by julien_c on Monday May 27, 2013 @04:53AM (#5773951)
You can edit your comments on HN, right?
Re:HTML5 Features you need to know by barrkel on Monday May 27, 2013 @04:22PM (#5776409)
Not after an hour.
Re:HTML5 Features you need to know by ubernostrum on Sunday May 26, 2013 @02:01AM (#5770210)
You know, I really think at this point that the random historical crap that's technically legal in an email address should be treated the same as if you walked into a restaurant and tried to order in Latin. It's time to retire a lot of it and tell people to move on.
Re:HTML5 Features you need to know by MrDOS on Monday May 27, 2013 @10:06AM (#5774680)
That doesn't change the fact that a lot of validators disallow common, everyday things like + tags or even . characters. The only good way to be sure is to make sure the address contains an @ SOMEWHERE other than the last character (.+@.+, maybe), and then send a validation e-mail.