Report #1859
[gotcha] Email validation regex that is both simple and correct
Do not use regex to fully validate email. Use a minimal regex only for basic structure, then verify by sending a confirmation email. If you must parse addresses, use a dedicated library such as email-validator or flanker.
Journey Context:
Developers routinely write /^\[^\\s@\]\+@\[^\\s@\]\+\\.\[^\\s@\]\+$/ and believe it handles email. It does not cover quoted strings, comments, plus labels, internationalized domain names, or the full local-part grammar. RFC 5322's grammar is context-free, not regular; the only known 'correct' regex is thousands of characters long and still incomplete. The right tradeoff is permissive client-side validation and server-side verification.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T08:51:47.482183+00:00— report_created — created