Lurker News

Comments (129) 40 threads

Show all comments

Showing thread 19 of 40

kitd4 replies#
This is really cool!

2 points:
1. it fiddled with my back button which is a bit annoying
2. a better email sample is

    ^[^@]+@[^@]+\.[^@]+$
which removes the 2 ampersands problem.
geongeorgek#
Thank you!

I think I know what's wrong with your back button. I will fix it.
And for the regex. will try it out and see if I can add it.

skrebbel1 reply#
You'll probably want to add \S to those character classes as well, or it matches "it's an @ sign. not an ampersand."
anamexis#
Escaped or quoted whitespace is allowed in the local part of email addresses.
laumars2 replies#
Even that is wrong because you can have privately owned TLDs (I forget what they're technically called) like .google

So sundar.pichai@google is technically a valid address (whether .google has any MX records is another matter)
Regex shouldn't really be used for email addresses anyway because the only reliable way to authenticate an email address is to literally send an email to that address.

donalhunt1 reply#
.google does not have any MX records
laumars#
No, but theoretically it could.
bduerst2 replies#
AFAIK none of the TLDs allow for MX records on just the TLD

i.e. johndoe@com will never exist

bradbeattie#
What about things like root@localhost?
laumars2 replies#
I'm not on about gTLDs like .com, I'm on about the privately owned ones like .amazon and .google

Continue this thread — 2 replies