JRS: In article <
[email protected]>, seen in
As a non-.com-user, I would recommend just
var re = /.+@.+\..+/;
It accepts anything with a @ and a . in that order and with something
around it. Most attempts at being more precise will usually rule out
some perfectly good e-mail address.
There is the question of purpose.
If the wish is to accept anything that includes what might be an E-mail
address, one may need just that. It does, however, accept itself, which
seems generous.
I doubt whether anyone would intentionally provide a "normal" address
with anything but letters (plural) in the final field, so such a test
for that field being alpha 2+ should be safe enough, and would catch a
few gross blunders.
It is not the test used by my mailer Turnpike, though.
Turnpike will accept a mere (e-mail address removed)
and <
[email protected]>
but rightly also a full Lasse Reichstein Nielsen <
[email protected]>
It rightly rejects Lasse R. Nielsen <
[email protected]>
and accepts "Lasse R. Nielsen" <
[email protected]>
It rightly accepts also the possibly-deprecated form
(e-mail address removed) (Denmark)
It rejects, in those, unmatched punctuation.
Where a form requires that an E-mail address be provided, the designer
should consider whether a fuller form should be allowed; and, if so,
that fuller form should be validated to Internet standards.
If collecting name & address * date of birth & e-mail address, the extra
may not be needed. But if the E-address given is to be used, then one
should IMHO be allowed to give it in a full form.