Regex for Email Validation

A practical regex for email validation with test cases. Try the pattern against valid and invalid addresses and learn why perfect email regex does not exist.

Part of the free Regex Tester. Runs in your browser — nothing is uploaded.

Regex for Email Validation

A simple, practical email regex checks for something@something.tld without whitespace. It catches typos, not every invalid address. For real verification, send a confirmation email.

Worked example: Valid and invalid addresses

Pattern /^[^\s@]+@[^\s@]+\.[^\s@]+$/ — test strings

^[^\s@]+@[^\s@]+\.[^\s@]+$

ada@example.com
first.last+tag@mail.co.uk
not-an-email
missing@tld
space @example.com

Result for each line

✓ match     ada@example.com
✓ match     first.last+tag@mail.co.uk
✗ no match  not-an-email
✗ no match  missing@tld
✗ no match  space @example.com

Practical tip

Use the regex for fast client-side feedback and your server or a confirmation link for the final word. The full RFC 5322 grammar is too complex to capture reliably.

How to use this Regex Tester

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Regex for Email Validation FAQs

Can a regex fully validate an email address?

No. A regex can reject obviously wrong input but cannot prove a mailbox exists. Verify by sending a confirmation message.

Why avoid very strict email patterns?

Strict patterns often reject valid addresses with plus signs, new TLDs or international characters, which costs you real users.

More Regex Tester pages

Open the full Regex Tester tool →