4 ms·
I gave up validating an email address a long time ago. Now all I will do is sanitize it to be safe from malicious attempts. The tipping point for me was trying
by jnorthrop 17y ago
I gave up validating an email address a long time ago. Now all I will do is sanitize it to be safe from malicious attempts. The tipping point for me was trying to decipher an unreasonably long regular expression written months prior to find out why someone's funky address (like the author's) was failing -- wasted time.
You can try, but you can't prevent people from doing dumb things, and in the attempt you end up potentially making mistakes like in the case of the article. Users will always do something unanticipated. With that in mind I only validate the things that really matter (e.g. credit card numbers, social security numbers, etc.). If someone wants to enter "jane at aol" as their address, I have to think, "is this going to a problem for my company?" If not, don't bother to try to fix it.