Email Address Regular Expression That 99.99% Works
emailregex.com
emailregex.com
(And you certainly don’t want to send every bcc a verification email they have to click on!)
That neither solution proposed upthread - double inputs, or a verification email - is as user-friendly as catching "oops you forgot a dot" validation on the field in an email client.
To put another way, as anecdotal experience I've encountered many forms online that won't accept my email address or phone or whathaveyou because of buggy validation. I can't recall when I mistyped my email, but surely it's possible I've done it at some point, however the difference is in the price I pay. If I mistype my email and don't get a confirmation email or w/e I can always try signing up again. However if I can't use the form because the validation is bugged there is no straightforward recourse I can take as a user.
Btw content is unreadable thanks to aggressive adblocker detection so much that this feels like spam.
If you’re building a web app, foo@gmailcom is almost certainly a mistake.
I can't check that 123-45-6789 is a valid Social Security Number, but I can still reject "FARTS".
The same is true for "foo@gmailcom" for a public-internet facing contact us form.
Check if there’s an @ and send a verification email.
I remember some story back in the day where someone had an email address using the top level to domain only. Like “x@to”, pretty cool but probably a pain to use (:
For a quick check to make sure people don't mix up fields or accidentally hit enter before they finished typing, just /.+@.+\..{2,}/ is more than enough (technically foo@com is valid, but no one uses that – note that root@localhost or cron@sysops CAN be valid, so in some contexts you want to use just /.+@.+/, but that doesn't really apply for signups and the like).
> "just /.+@.+\.{2,}/ is more than enough"
Isn't that asking for 2x '.'s after the @, which isn't required?Should instead be /.+@.+\..+/ Which will allow foo@bar.com but not foo@bar ?
[1] https://fightingforalostcause.net/content/misc/2006/compare-...
Sorry I didn't knew of this adblock detection nonsense, otherwise wouldn't have posted it. :(