Report #4696
[gotcha] Email validation regex that rejects valid addresses or accepts invalid ones
Don't use regex to validate email in production; send a verification message. If you must pre-check syntax, use the WHATWG pattern and treat it as a permissive filter, not a deliverability guarantee.
Journey Context:
Copying a giant regex or using a simple ^\\S\+@\\S\+\\.\\S\+$ both fail in opposite directions: the giant ones miss RFC 5322 edge cases like comments, quoted strings, and plus labels, while the simple ones accept [email protected]. RFC 5322 permits many addresses real mail systems reject, and real inboxes use forms that confuse hand-rolled patterns. The WHATWG pattern is the closest thing to a browser-agreed subset. The only reliable validation is to normalize and send a verification link.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:55:41.069807+00:00— report_created — created