Useful for simple input feedback.
Email validation regex: where a format check stops
Use format checks for immediate feedback, then validate the domain and the evidence your workflow needs. A regex never contacts a mail server.
Use a maintained parser and a clear support policy.
Check routing and confirm the inbox when needed.
What an email regex can check
A regular expression can catch obvious input mistakes such as a missing @ sign or accidental whitespace in a simple address. It evaluates a string. It cannot tell whether the domain exists, whether mail routing is configured or whether a recipient can read messages.
More about What an email regex can check
Trying to encode every supported mail syntax rule in a home-grown expression creates a maintenance burden. A rule that accepts only short top-level domains, strips plus tags or rejects every unfamiliar character can turn genuine customers away.
Use three layers of validation.
- Browser: use type="email", an accessible label and autocomplete="email" for ordinary address entry. Keep the original value visible when reporting an error.
- Backend: parse the address using a maintained library, enforce reasonable input limits and document your international-address support. Browser validation alone is bypassable.
- Domain and workflow: inspect mail routing, distinguish temporary failures and use inbox confirmation for actions that require control of the destination.
Test legitimate variations and ambiguous outcomes.
Your tests should include plus-tagged local parts, subdomains, long top-level domains and internationalised domains. Include quoted local parts or SMTPUTF8 cases according to your stated support policy. A supported parser result and your mail infrastructure’s capabilities both matter.
More about Test legitimate variations and ambiguous outcomes.
Keep DNS fixtures for a normal MX route, explicit Null MX, implicit A/AAAA routing, nonexistent domains and timeouts. Avoid tests that assume every missing MX is invalid or every exception means the user supplied a bad address.
For provider-specific restrictions, establish that the domain belongs to the provider before applying its grammar. Do not globally remove dots or tags based on rules from one popular mailbox service.
Write feedback that helps the user finish.
For a malformed address, explain the required format and let the user edit it. For a suspected domain typo, ask whether the suggested spelling is intended. For a failed external check, say that verification is temporarily unavailable and provide a retry path.
More about Write feedback that helps the user finish.
An API key belongs on your server. Debounce any optional remote checks, avoid sending every partial keystroke and make the final server-side check authoritative. Keep raw email addresses out of analytics and query strings.
Choose the next check for your product.
A newsletter needs a usable destination and the right subscription permission. A whitepaper form may need a confirmation link. An education discount needs a separate institution and eligibility policy. The same format check can support all three, but it does not replace the rest of the workflow.
Common questions
What is the best regex to verify an email address?
No regex can establish mailbox existence or inbox control. Use a maintained parser for your supported syntax, DNS checks for mail routing and a confirmation flow where control matters.
Should I remove plus tags from email addresses?
Preserve the local part unless the user approves a change under a verified provider-specific policy. Tags can be meaningful, and stripping them globally can change the intended address or break the user’s workflow.
Email Verification for Gated Content & Whitepapers
Catch address mistakes at the download form and give interested readers a clear route to your content. Apply your own policy to disposable and shared inboxes.
Explore the guideEmail Validation for One-Field Newsletter Signup
Let readers subscribe with their email address. Catch input mistakes early, then collect preferences when there is a good reason to ask.
Explore the guideAcademic Email Checks for Education Discounts
Use an academic email as a low-friction starting point for education discounts, with a clear fallback when the address alone cannot establish eligibility.
Explore the guideGive every address a clear next step.
Discuss your form, address-quality rules and integration scope. Endpoint availability and enabled checks are confirmed during onboarding.