Email address regex
Practical email validation regex. Requires at least one character before `@`, at least one between `@` and the last `.`, and at least one after. Anchored start to end so the entire string must be the email — useful when validating a single input field, not when extracting emails from prose.
Caveats
Real email syntax (RFC 5322) is hundreds of lines of grammar with quoted-string local-parts, comments, IP-address domains, and edge cases nobody uses in practice. This pattern catches obvious typos but accepts strings that the SMTP standard rejects. For real validation, send a confirmation email — that's the only definitive check.
Test strings
A mix of values that should match and values that shouldn't — paste these into the tester to see them light up live.
- alice@example.com
- bob.brown+filter@sub.domain.io
- no-at-sign.com
- @missing-local.com
- missing-domain@
- spaces in@email.com