Closed gfarrell closed 8 years ago
TBH I think the only really sane way of validating email addresses is (.+)@(.+)
, everything else is prone to failure, perhaps with one exception http://cubicspot.blogspot.co.uk/2012/06/correct-way-to-validate-e-mail-address.html
@gfarrell Well, (.+)@(.+)
permit whitespace. I'd accept a PR with a similarly permissive check (but disallowing whitespace).
:+1:
Actually, @rhys-vdw, it looks like whitespace is permitted, with conditions, as per the Wikipedia article: https://en.wikipedia.org/wiki/Email_address#Local_part
The whole thing is further complicated by comments. I think that /^(.+)@(.+)$/
is probably the only sensible matcher in these circumstances.
I'll submit a pull request.
Turns out (who knew?) that apostrophes are allowed in email addresses. Rather embarrassingly one of our customers was unable to login, I discovered that checkit invalidates an email address with an apostrophe in it 😢 .