Regex for Email Validation
A balanced regex for everyday email validation (not strict RFC 5322).
Input
^[\w.+-]+@[a-zA-Z\d-]+(\.[a-zA-Z\d-]+)+$
Output
Matches: ada@example.com, l.t@univ.ac.uk, test+spam@gmail.com Does not match: invalid@, @nope.com, no-at-sign.com
How it works
Covers ~99% of real-world email addresses. For strict compliance use a server-side library, regex alone can't perfectly validate email per the RFC.
Try it yourself
Open the full Regex Tester to run this example on your own data.
Open Regex Tester