Report #2113
[gotcha] Email validation regex that actually works
For practical client-side validation, use the HTML5 'valid e-mail address' regex: /^\[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\]\)?\)\*$/. For backend assurance, send a verification email instead of relying on regex.
Journey Context:
RFC 5322 permits quoted strings, comments, and domain literals, so a fully correct regex is enormous and still incomplete. Many hand-rolled patterns reject valid addresses \(e.g., \+tags, .surnames, internationalized domains\) or accept invalid ones. The HTML5 spec deliberately chose a pragmatic subset that matches real-world addresses without trying to enforce the full RFC. If you need strict validation, parse with a library \(e.g., email-validator in Python\) and confirm by sending mail.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:58:33.538182+00:00— report_created — created