Email Address Regex
A practical email pattern, pre-loaded in the tester so you can try your own addresses. Below it, a table shows which addresses it accepts and rejects, including the places it is looser or stricter than the email standard.
What this email address pattern accepts and rejects
This is a practical pattern for sign-up forms, not an RFC 5322 validator: it checks the everyday shape name@domain.tld and nothing more. That is usually the right trade, since the only real proof an address works is a confirmation email, but it is worth knowing where it is looser and stricter than the standard.
Each input below was tested on its own against the pattern above when this page was built, with no flags, so ^ and $ anchor the whole value. Paste any of them into the tester to see the same result.
| Input | Result | Why it matters |
|---|---|---|
test.user@example.com | Matches | The everyday shape. |
first+tag@example.org | Matches | Plus addressing (sub-addressing) is allowed, which matters: many people filter mail with it. |
admin@sub.domain.co.uk | Matches | Subdomains and two-part public suffixes pass. |
a..b@example.com | Matches | Accepted, although two dots in a row are not allowed in an unquoted local part. Looser than the standard. |
.lead@example.com | Matches | Accepted, although a local part may not start with a dot. Looser than the standard. |
user@example.c | No match | Rejected: the last label must be at least two letters. |
user@localhost | No match | Rejected: the domain needs a dot. Legal on a local network, rarely wanted in a public form. |
"quoted local"@example.com | No match | Rejected: quoted local parts are legal but almost never used. Stricter than the standard. |
user@[192.168.0.1] | No match | Rejected: IP-literal domains are legal but rare. Stricter than the standard. |
用户@例子.广告 | No match | Rejected: the pattern is ASCII-only, so internationalised addresses (RFC 6531) fail. Decide whether your audience needs them. |
invalid-email@ | No match | Rejected: no domain. |
More from RegexCalc
Guides
Frequently Asked Questions
Is this email regex RFC 5322 compliant?
No, and that is deliberate. It checks the everyday shape name@domain.tld, so it accepts some addresses the standard forbids, such as a..b@example.com, and rejects some it allows, such as quoted local parts and IP-literal domains. For sign-up forms that trade is usually right, and the only real test of an address is a confirmation email.
Why does the email regex reject addresses with non-English characters?
Its character classes are ASCII-only, so internationalised addresses such as 用户@例子.广告 fail. If your users need them, accept them separately or rely on a confirmation email instead of a pattern.