Report #702
[gotcha] Need a regex to validate email addresses
Don't. Use a permissive regex only for basic syntax, then send a verification email. If you must parse, use a dedicated parser such as Python's email-validator, Mail::RFC822::Address, or Java's Apache Commons EmailValidator. RFC 5322 permits comments, quoted strings, and IP literals that no regex handles correctly.
Journey Context:
Developers keep trying to write the perfect email regex, but the canonical grammar in RFC 5322 is not regular. Valid addresses like user\[email protected], 'spaces and quotes'@example.com, or user@\[IPv6:2001:db8::1\] defeat common patterns. A strict regex rejects real addresses; a permissive one accepts garbage. The only true validation is deliverability, which means sending a confirmation message. Use regex only as a lightweight prefilter, never as the authority.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T11:55:37.544376+00:00— report_created — created