|
|
|
|
|
by JoeAcchino
4775 days ago
|
|
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). |
|
^[^ @]+@[^ @]+$
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.