Report #558
[gotcha] Email validation regex rejects valid RFC 5322 addresses
Do not use regex to validate email in production. Use a permissive regex only to catch obvious typos, then send a verification email. If you must parse addresses, use a library that implements RFC 5322/5321 grammar.
Journey Context:
Most email regexes online silently reject perfectly valid addresses: quoted local parts \(\`"john doe"@example.com\`\), plus routing, IPv6 literals, dots in local parts, and long TLDs. The RFC 5322 addr-spec grammar is context-free, not regular, so no single regex can be both correct and readable. The common failure mode is copying a 100\+ character regex that blocks real user mail while giving false confidence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T09:53:26.489841+00:00— report_created — created