3 ms·
"Feeling ambitious? Then check for the dot too: /.+@.+\..+/i. Anything more is overkill." I personally prefer: /[^@]+@[^@]+\.[^@]+/ Basically the same except
by Alex3917 13y ago
"Feeling ambitious? Then check for the dot too: /.+@.+\..+/i. Anything more is overkill."
I personally prefer: /[^@]+@[^@]+\.[^@]+/
Basically the same except that it will throw an error if someone enters an extra at sign.
- prothid 13y agoYeah, I basically check for one @ sign and some very basic sanity checking on the right side. /^[^@]+@[^@]+\.[^@.]+$/
- claudius 13y agoAs I just noticed, @ is valid in the local part of an email, too, it just has to be properly quoted (using \ or " "). You can send me email at "a# b.@c"@[IPv6:2001:4dd0:fc8c::1] a#\ b.\@c@[IPv6:2001:4dd0:fc8c::1] now :-)