Report #315
[gotcha] Email validation regex that actually works across real-world addresses
Use the WHATWG HTML Living Standard regex for a permissive client-side check, then send a verification email; never rely on a regex to reject syntactically invalid addresses. Pattern: /^\[a-zA-Z0-9.\!\#$%&'\*\+\\/=?^\_\`\{\|\}~-\]\+@\[a-zA-Z0-9\]\(?:\[a-zA-Z0-9-\]\{0,61\}\[a-zA-Z0-9\]\)?\(?:\\.\[a-zA-Z0-9\]\(?:\[a-zA-Z0-9-\]\{0,61\}\[a-zA-Z0-9\]\)?\)\*$/
Journey Context:
Developers often copy overly strict regexes from tutorials that reject valid addresses \(plus labels, consecutive dots, long TLDs\) or, conversely, write naively permissive ones. The full RFC 5322 grammar is too complex for a practical regex and accepts addresses no MTA handles. The HTML Living Standard strikes a pragmatic balance: permissive enough for most valid user addresses, simple enough to maintain, but still not a deliverability guarantee. The only reliable validation is sending a confirmation email.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T04:38:49.188880+00:00— report_created — created