Generate Regular expression for email based on your rules. OR Enter your regular expression and use validator below to verify different email inputs
Regex Pattern
Min Length
Max Length
Allowed Chars
Case Selection
You can enter different emails to validate for above generated Regular expression. You can also copy other email regex patterns in Regex field and validate it here
Enter email to verify
Regex Expressions for different Email Address patterns
Input | Expression | Example |
---|---|---|
Default Email format-alphanumeric,dot,underscore,hyphen | ^[A-Za-z0-9_.-]{1,64}@(.+)$ | abc.Xyz@gmail.com abc-xyz@gmail.com abc_xyz@gmail.com abc-123@gmail.com |
Allow Alphabets any case | ^[A-Za-z]{1,64}@(.+)$ | abcXyz@Gmail.com |
Allow Numbers | ^[A-Za-z0-9]{1,64}@(.+)$ | abc123@gmail.com |
Allow Only UpperCase | ^[A-Z]+@[A-Z].+[A-Z]$ | ABC@GMAIL.COM |
Allow Only LowerCase | ^[a-z]+@[a-z].+[a-z]$ | abc@gmail.com |
Allow - Hyphen | ^[A-Za-z-]{1,64}@(.+)$ | abc-xyz@gmail.com |
Allow . Dot | ^[A-Za-z.]{1,64}@(.+)$ | abc.xyz@gmail.com |
Allow _ Underscore | ^[A-Za-z_]{1,64}@(.+)$ | abc_xyz@gmail.com |
Allow + Plus | ^[A-Za-z+]{1,64}@(.+)$ | abc+xyzj@gmail.com |
Allow % Percent | ^[A-Za-z%]{1,64}@(.+)$ | abc%xyz@gmail.com |
Allow ~ Tilde | ^[A-Za-z~]{1,64}@(.+)$ | abc~xyz@gmail.com |
Allow ? Question mark | ^[A-Za-z?]{1,64}@(.+)$ | abc?xyz@gmail.com |
Allow $ Dollar | ^[A-Za-z$]{1,64}@(.+)$ | abc$xyz@gmail.com |
Allow # Hash | ^[A-Za-z#]{1,64}@(.+)$ | abc#xyz@gmail.com |
Disallow Leading / Trailing , consecutive Dots like | ^(?!.*..)[A-Za-z0-9_.-]{1,64}@(.+)$ | abc..xyz@gmail.com |
Standard Domain | ^[a-z]+@[a-zA-Z0-9-].+[a-z]$ | abc@domain.com , abc@domain-123.com |
Top Level domain | ^[a-z]+@[a-zA-Z0-9-]+?.[a-z]{2,3}$ | abc@gmail.com |
Minimum Length check before @ part | ^[A-Za-z0-9_.-]{5,64}@(.+)$ | abcXyz@gmail.com |
Maximum Length check before @ part | ^[A-Za-z0-9_.-]{1,10}@(.+)$ | abc-Xyz123@gmail.com |
Frequently Asked Questions on Email Addresses
Regex is a short form for Regular Expression.
A regular expression is composed of a pattern of text strings or rules.
Regular expression can be used to check for conformance of an input to the expression as in email or phone validation or it can be used to search and find matches in the data.
Example of an expression tht matches for presence of only alphabets in lower case in email before domain ^[a-z]+@[a-z].+[a-z]$.
Regex / Regular expressions are best for checking valid email address formats.
We cannot use regex to check if email itself exists.
It can only determine if the email format is proper as per the email standard format.
Uppercase letters A-Z, Lowercase letters a-z Numbers 0-9, .
Dot, Hyphen -, Underscore _
As per RFC 5322, Internet email addresses must include only RFC-compliant characters, which include:
Uppercase letters A-Z, Lowercase letters a-z
Numbers 0-9, . Dot, Hyphen -, Underscore _ and others such as ! # $ % & ' * + - / = ? ^ _ ` { | } ~
No spaces are allowed in an e-mail address
As per RFC 2822, Internet email addresses does not allow for blank spaces,white space SHOULD NOT be used around the "@" that is the “local-part” before the “@”.
RFC 5322 (https://www.ietf.org/rfc/rfc5322.txt)
This allows support for a lot of characters which many standard email servers do not really support.