tools / regex library / email address
regex pattern · ready to copy

Regex for matching email addresses

Matches RFC-5322 emails for form validation. Practical, not pedantic.

intermediate javascript / pcre / python4 use cases

The pattern

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

Looser variant (more permissive, fewer false rejects):

[\w.+-]+@[\w-]+\.[\w.-]+

Test cases

InputResult
alice@voiddo.commatches
user.name+filter@example.co.ukmatches
a@b.iomatches
plainstringrejects
@no-local.comrejects
missing-domain@rejects
double@@at.comrejects

Edge cases & caveats

Doesn't enforce IDN (international domains) or quoted local-parts. For form validation, use HTML5 `type="email"` first; this regex is for log scraping or list cleanup.

Common use cases

Try variations against your data
regexlab is a free in-browser tester with side-by-side match highlighting, group inspector, and named-capture export to JS/Python/PCRE.
Open regexlab  

Related

uuid · uk postcode · sql injection keywords · ipv4 address · ↗ audit SPF records for the domain