Report #99259
[gotcha] Email validation regex that fully complies with RFC 5322
Do not use a single regex to validate email. Use the HTML5/WHATWG email-state regex only for basic syntax checking, then send a verification email to confirm deliverability. In Python use \`email-validator\` or Django's \`EmailValidator\` for stronger checks.
Journey Context:
Developers often copy or write a giant regex meant to cover quoted strings, comments, IP literals, and every corner of RFC 5322. This is a losing battle: the email grammar is not regular, so the regex becomes unreadable, rejects valid addresses, and accepts invalid ones. The HTML5 spec deliberately defines a much simpler email format for form validation because real correctness comes from deliverability, not grammar parsing. The right call is a lightweight syntax check plus a confirmation message.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:50:11.710716+00:00— report_created — created