Suggested pattern
^[^\s@]+@[^\s@]+\.[^\s@]+$
What it matches
alice@example.com
john@test.org
Common limitations
- Checks only the general format.
- Does not verify whether the domain or mailbox actually exists.
Suggested pattern
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
What it matches
alice@example.com
john.doe+shop@test.co.uk
Common limitations
- Does not implement the complete RFC specification.
- Should be combined with confirmation emails or server-side verification.
Suggested pattern
^[^\s@]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$
What it matches
alice@mail.example.com
john@example.co.uk
Common limitations
- Still validates only the structure.
Suggested pattern
^[A-Za-z0-9._%+-]+@gmail\.com$
What it matches
alice@gmail.com
bob@gmail.com
Common limitations
- Useful only when Gmail addresses are specifically required.
Suggested pattern
^[A-Za-z0-9._%+-]+@company\.com$
What it matches
alice@company.com
sales@company.com
Common limitations
- The domain must be adapted to your organization.
Suggested pattern
[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}
What it matches
alice@example.com
bob@test.org
Common limitations
- May also match invalid addresses embedded in malformed text.
Suggested pattern
^\s*[^\s@]+@[^\s@]+\.[^\s@]+(?:\s*,\s*[^\s@]+@[^\s@]+\.[^\s@]+)*\s*$
What it matches
alice@example.com, bob@test.org
Common limitations
- Designed for comma-separated lists only.
Suggested pattern
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
What it matches
john+shop@example.com
alice+newsletter@gmail.com
Common limitations
- Some systems choose to normalize or restrict aliases for business reasons.
Suggested pattern
(?<=@)[A-Za-z0-9.-]+\.[A-Za-z]{2,}
What it matches
example.com
mail.company.org
Common limitations
- Uses lookbehind, so check compatibility with your regex engine.
Suggested pattern
^[^\s@]+(?=@)
Common limitations
- Designed for one email address per line.
Suggested pattern
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.org$
What it matches
team@example.org
support@test.org
Common limitations
- Change .org to the TLD required by your use case.
Suggested pattern
^[A-Za-z0-9._%+-]+@(?!gmail\.com$|yahoo\.com$|hotmail\.com$|outlook\.com$)[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
What it matches
alice@company.com
sales@example.org
Common limitations
- Only excludes the providers listed in the pattern.
Suggested pattern
[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}
What it matches
sales@example.com
help@test.org
ceo@company.com
Common limitations
- May also match malformed addresses that look valid.
Suggested pattern
[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}
What it matches
alice@example.com
bob@test.org
Common limitations
- The replacement itself depends on your programming language.
Suggested pattern
^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
Common limitations
- Rejects valid addresses used by many email providers.
Suggested pattern
^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.(?:com|org|net)$
What it matches
alice@example.com
bob@test.org
Common limitations
- Requires regular updates as new TLDs appear.
Why email regex validation is difficult
Email addresses look simple, but the official syntax is much more flexible than most people expect.
In real applications, a practical regex usually checks the common structure instead of trying to implement every possible RFC-valid address.
The goal is usually to catch obvious mistakes, not to prove that an address exists or can receive mail.
Practical email regex vs RFC-compliant regex
Fully RFC-compliant email regexes are often extremely long, difficult to read and hard to maintain.
For most forms, a practical regex combined with email confirmation is safer and easier to understand.
Use strict RFC validation only when your application specifically needs to accept every valid edge case.
What an email regex can validate
An email regex can check for a local part, an @ symbol, a domain name and a top-level domain.
It can also restrict characters, require a minimum TLD length or reject whitespace.
However, it cannot confirm DNS records, mailbox existence or whether the address belongs to the user.
Email aliases and plus addressing
Many email providers support aliases such as john+shop@example.com.
Rejecting the plus sign can block valid users, especially on Gmail and developer-oriented services.
Unless you have a specific reason to forbid aliases, your regex should usually allow plus addressing.
International email addresses
Modern email systems can support internationalized domain names and, in some contexts, non-ASCII local parts.
Many simple email regexes intentionally focus on ASCII-only addresses because they are easier to support consistently.
If your application targets international users, test Unicode behavior carefully and consider using dedicated email validation libraries.
Confirming an email address
The most reliable way to verify an email address is usually to send a confirmation message.
A regex can reduce typos, but only confirmation proves that the user can access the mailbox.
For account creation, password reset and sensitive workflows, email confirmation is more important than making the regex stricter.