Email Validation

Email Regex Test Cases

Use a focused list of valid and invalid email samples to review regex behavior before shipping a form or API validator. Last updated September 14, 2026.

Use a focused list of valid and invalid email samples to review regex behavior before shipping a form or API validator. This reference is written for developers who need practical validation behavior, reviewable rules and safe examples rather than copied snippets with no explanation.

Recommended workflow

StepWhy it matters
Build a tiny matrixKeep a table of accepted, rejected and intentionally unsupported addresses.
Run the same samples everywhereBrowser, API, import jobs and tests should use the same fixtures.
Add regression casesEvery production validation bug should become one new sample.
Keep private data outUse synthetic examples instead of real user addresses.

Starter snippet

valid: dev@example.com, name+tag@example.co.uk
invalid: dev@, @example.com, dev example.com, dev@@example.com

Review checks

Common mistakes

Validation should help users correct input while protecting systems from bad data. Keep syntax checks, product policy, security review and deliverability checks separate.

Related Formalint references

Continue with Email Regex Cheatsheet, Developer Data Validation Guide, Regex Examples.