Y
Hacker News
new
|
ask
|
show
|
jobs
by
allegory
4280 days ago
I use a slightly more complex variation of that:
^.+@.+\..+$
Works wonders. I think when testing the addresses on a sign up form, we got only 0.5% that we couldn't relay too which was a pretty good hit rate.
3 comments
paulnechifor
4280 days ago
It looks to me like you're neglecting email addresses from <
http://ai./>
. The 'ai' TLD does have an MX record.
link
allegory
4280 days ago
Yes; I get told that every time I mention it :-)
link
tragomaskhalos
4280 days ago
I would suspect that anyone whose email did
not
match that regex would have such a miserable time generally getting it rejected as invalid left right and centre that they would just cave in and get a simpler one that did.
link
TezzellEnt
4279 days ago
That's pretty good. I learned from Rails Tutorial to use this one:
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
It's worked for me when I needed to use it.
link
PinguTS
4279 days ago
Hope you don't have international customers, because
http://äöüß.de
is a totally legal domain these days.
link
allegory
4279 days ago
Very true. My simplified one on the parent comment of that one makes no attempt to involve Unicode or character ranges for precisely that reason!
link