MailParse/Tools/Email Regex Validator
Developer Tool

Free Email Regex Validator

An email regex validator is a tool that tests a regular expression against a list of email addresses and shows which ones pass and which fail. Paste your regex, drop in some test emails, and get instant results - no signup, no upload.

Built for developers writing form validation, signup flows, or data cleaning scripts. Pick a pre-built pattern (Simple, Standard, HTML5, or full RFC 5322), tweak it, and watch the matches update live.

Pick a preset

Load a known-good pattern, or write your own below.

HTML5 input pattern: The exact pattern the WHATWG HTML5 spec uses for <input type="email">. Pragmatic, not strict RFC 5322 - it permits most real addresses, enforces label length limits, and rejects leading/trailing hyphens in domain labels.

Regex pattern

JavaScript-flavored regex. Slashes are added automatically.

//

Regex compiled successfully

Test emails

One per line. Whitespace-only lines are ignored.

25 emails

Results

Live as you type. No data leaves your browser.

13 passed12 failed
EmailResult
simple@example.comPass
first.last@example.comPass
user+tag@gmail.comPass
user.name+filter@sub.example.co.ukPass
"quoted local"@example.comFail
admin@mail-server.ioPass
support@xn--bcher-kva.examplePass
hello@localhostPass
user@[192.168.1.1]Fail
user@[IPv6:2001:db8::1]Fail
名字@example.comFail
plainaddressFail
@no-local.comFail
no-at-sign.comFail
double..dot@example.comPass
trailing.dot.@example.comPass
.leading.dot@example.comPass
spaces in@example.comFail
user@no_underscores_in_domain.comFail
user@-leadinghyphen.comFail
user@trailinghyphen-.comFail
user@example.cPass
user@examplePass
user@example.comPass
user @example.comFail

How to use the email regex validator

1

Paste or pick your regex

Type a regex pattern into the input, or pick one of the built-in presets (Simple, Standard, HTML5, RFC 5322) to load a known-good pattern.

2

Enter test emails

Paste one email address per line into the test inputs textarea. The default sample includes valid, invalid, and tricky edge cases.

3

Review pass/fail results

Each address is matched against your regex live. Read the pass/fail badges and the summary to see which addresses your pattern accepts and which it rejects.

Frequently asked questions

What is an email regex validator?

An email regex validator is a tool that tests a regular expression against a list of email addresses and reports which addresses match and which do not. It is used to verify that an email validation pattern accepts the addresses it should and rejects the ones it should not before shipping the regex into a form, API, or database constraint.

What is the best regex for validating email addresses?

There is no single best regex - it depends on how strict you need to be. For most web forms, the HTML5 input pattern is the right balance: it accepts virtually every real-world address and matches the behavior of <input type="email"> in modern browsers. Use the simple pattern for quick sanity checks, and only reach for full RFC 5322 if you actually need to accept quoted local parts and IP-literal domains.

Does the HTML5 email pattern follow RFC 5322?

No. The HTML5 spec deliberately uses a willful violation of RFC 5322 to keep the pattern short and pragmatic. It rejects valid but exotic addresses like quoted local parts ("foo bar"@example.com) and IP-literal domains (user@[192.168.1.1]), but in exchange it matches what users and developers actually expect.

Can I validate international (Unicode) email addresses with regex?

Plain ASCII regex patterns will reject internationalized email addresses like 名字@example.com or user@münchen.de. To accept them, you need a Unicode-aware pattern using \p{L} character classes with the u flag, or you can validate the punycode form (xn--...) of the domain. Most production systems normalize to punycode before validation.

Is regex enough to validate an email address?

No. Regex can only confirm that an address looks syntactically plausible - it cannot tell you the domain exists, the mailbox is real, or that mail will be delivered. For real validation, combine a permissive regex with an MX record lookup and, where appropriate, an SMTP check or a confirmation email.

Related tools

Need to extract data from emails programmatically?

MailParse turns inbound MIME emails into structured JSON and delivers it via webhook or REST polling - skip the parser, ship the feature.