Comparing E-mail Address Validating Regular Expressions

by Ian Dunn

I wanted to find a regular expression to validate e-mail addresses, but when I searched I found dozens of slightly different versions of the same expression. Almost all of them had people leaving comments about how it failed to validate or invalidate some rare but completely valid/invalid address syntax. But dispite all the criticism, I couldn’t find a definitive “best” expression. So, I setup arrays of some of the most promising expressions as well as a (hopefully) complete sampling of valid and invalid addresses and found the best regular expression to validate an e-mail address.

Leave a Comment