Re:HTML5 Features you need to know
by JoeAcchino on Saturday May 25, 2013 @05:25PM
(#5768913)
This regexp
will validate strings like `@example.com` and `joe@` and even a single `@`. Probably
is what he wants, plus server side validation (that is the classic "click link to validate address" email).
[ Parent
| on HN ]
Re:HTML5 Features you need to know
by Tautologistics on Sunday May 26, 2013 @02:29PM
(#5771956)
Forgot the SOL/EOL markers; the above will still match a substring, e.g. xxx@[email protected]. Try:
^[^ @]+@[^ @]+$
That said, HTML5 has something even better if the input is expected to be an email address: input@type=email
See http://www.w3.org/TR/html-markup/input.email.html for more details.