RegexCalc Regex Engine

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.

Regular Expression JAVASCRIPT REGEX
/ / gm
Match Status
2 matches found
Pattern Valid
Recipes:
Test String
Extracted Matches

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.

InputResultWhy it matters
test.user@example.comMatchesThe everyday shape.
first+tag@example.orgMatchesPlus addressing (sub-addressing) is allowed, which matters: many people filter mail with it.
admin@sub.domain.co.ukMatchesSubdomains and two-part public suffixes pass.
a..b@example.comMatchesAccepted, although two dots in a row are not allowed in an unquoted local part. Looser than the standard.
.lead@example.comMatchesAccepted, although a local part may not start with a dot. Looser than the standard.
user@example.cNo matchRejected: the last label must be at least two letters.
user@localhostNo matchRejected: the domain needs a dot. Legal on a local network, rarely wanted in a public form.
"quoted local"@example.comNo matchRejected: quoted local parts are legal but almost never used. Stricter than the standard.
user@[192.168.0.1]No matchRejected: IP-literal domains are legal but rare. Stricter than the standard.
用户@例子.广告No matchRejected: the pattern is ASCII-only, so internationalised addresses (RFC 6531) fail. Decide whether your audience needs them.
invalid-email@No matchRejected: no domain.

More from RegexCalc

Guides

All tools →All 13 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.

Developer Sponsor / Partner
Copied to clipboard!