Skip to content

Comment on Stop Validating Email Addresses With Your Complex Regexesparent

Comments

So to sum up the comments on the previous submission:

1) Someone did make a fully compliant Regex https://github.com/larb/email_address_validator

2) Lots of people (including the author http://news.ycombinator.com/item?id=4486264) think that you should at least validate that the '@' is somewhere to avoid username / email mixups

3) If your regex fails for foo+tag@something.com lots of people get pissed. I learned you can use that for inbox sorting since foo+tag@something.com goes to foo@something.com.

4) There are other schools of thought that promote validation and telling the user something is wrong like mailcheck.js (https://github.com/Kicksend/mailcheck), but these should not stop users from submitting forms.

Did I miss anything?

Yes.

5) Do some basic validation. If it fails, ask the user: Are you sure this email address is correct? If they say yes, then allow it anyway.

This lets you catch all the typos, without annoying people with more complicated email addresses.

That the solution proposed kills conversion and is unnecessary.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.