Great post on the issues with validating email addresses.
To sum up:
- if your regex is longer than /@/ you are doing it wrong.
- if you are using a regex you are doing it wrong.
Just send the user an email to activate their account. If the email gets delivered, then you know it’s valid.
There are always more characters that you haven’t thought of, and more top level domains that will appear in the future than your made up regular expression can handle.
There is a reason I want to sign up for your site with email@example.com.