Email validation Regexes

Now we want to review some email validation Regexes. We’ve chosen Regexes based on readability, complexity and RFC standarts relevance. For online Regex testing tools refer here.

General patterns

  • Simple pattern –  it works for major currently-used emails. It doesn’t validate IP-Addresses-based emails though :
  • Another pattern –  but when using it, be sure to lower the uppercase letters in the email prior to validation:
  • This pattern is more inclusive, yet again not allowing TLD (top level domain) to host mail addresses; like ‘nathan@dk’.
  • Some email validation Regexes are user contributed in RegexLib online library, having appropriate descriptions and use-boundary defined. There are many Regexes having either simple expression functions or more complex functions there.

RFC standards compliant

  • This Regex pattern for email validation is 100% RFC-2822 (RFC – Request For Comments) compliant:


  • The monster Regex for validating emails is here. It was generated by the Perl module by linking together a simpler set of regular expressions that relate directly to the grammar defined in the RFC-822.
  • The latest RFC on internet message format is the RFC-5322 (October 2008). This specification is a revision of Request For Comments RFC-2822, which itself superseded RFC-822.

JavaScript- and Perl-compatible



This one is used in ASP.NET by the RegularExpressionValidator:


The Regex compliant to the HTML5 spec. Read more here –

German email validator

Matches email addresses, which have ä ö ü Ä Ö Ü in name or domain:


Note on browser makers’ validation issue

Email validators are being used for many applications to match the strict yet inclusive RFC specifications. However, the latest trend is that many browser makers often ignore RFC’s standarts and redefine what is a valid email themselves. When creating INPUT TYPE=”email”, some makers allow only a simply-validated, reduced subset of email address formats, thus frustrating the users in normal web interaction when entering emails.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.