Email Address Regular Expression That 99.99% Works. Disagree? Join discussion!

Just copy and paste the email regex below for the language of your choice. Feeling hardcore (or crazy, you decide)? Read the official RFC 5322, or you can check out this Email Validation Summary. Note there is no perfect email regex, hence the 99.99%.

General Email Regex (RFC 5322 Official Standard)

Railroad Diagram of Above Regex (click to enlarge)

Free email address validator (with DNS lookup):

Try our FREE Email Form-Builder (with FREE email validation)

Regular Expression:

/ /

Test Strings:




In case you ever wonder, below is the regex used in type=”email” from W3C:

Swift (Regex only)

Swift (Regex used in a function)


Perl / Ruby

Perl 5.10 or newer


Ruby (simple version)

.NET (general pattern match)


Another way is to use the System.Net.Mail.MailAddress class. To determine whether an email address is valid, pass the email address to the MailAddress.MailAddress(String) class constructor.


Find All Email Addresses in a File using Grep

SQL Server Email Validation

Oracle PL/SQL Email Regex


Bonus: What does the following regex do?