KT。
Korelyy Toolskorelyy.com

Sign In / Sign Up

Welcome back — sign in to sync your favorites

Don't have an account?

By continuing you agree to our Terms and Privacy Policy

About Us

Meet the Korelyy team & mission

Privacy Policy

Our privacy commitment

Data Processing & Disclaimer

Data rules & disclaimer

Cookie Settings

Manage cookie preferences

Advertising & Support

Contact Us

Compliance

Tool verification

Blog

Tutorials, SEO guides & use cases

2026 Korelyy. All rights reserved.

My Toolbox

0 saved tools

No saved tools yet

Click the star button on tool cards to save them

History

0 records

No history yet

Your tool usage will be recorded automatically

My Profile

Manage your account info and preferences

?
-Free
-

Basic Info

-
Email & Password
Free
-

Security

This email was registered with a different method
← Back to all posts
regex正则表达式regexregexरेगेक्सالتعبير النمطيUpdated

Regex for Email Validation: A Complete Guide

Learn how to validate email addresses with regular expressions. From basic to advanced regex patterns, with real-world examples.

K
By Korelyy Team
August 5, 2026·8 min Read

Email validation is the most frequently copied regex on the internet, and most of the copies are wrong in the same way: they reject valid addresses that real people actually use. Before you paste a pattern into a signup form, it is worth understanding what a regex can and cannot do here, because the failure mode is silent. A rejected customer gets an error message and leaves.

The only authoritative check is delivery

An address is valid if a message sent to it arrives. No regular expression can determine that, because deliverability depends on DNS records, mailbox existence and server policy. Everything a regex does is catch obvious typos and malformed input before you send a verification email. Treat it as a filter, not as validation.

If you take one rule from this page: validate the shape of the address with a simple pattern, then verify it for real by sending a message with a time-limited link.

What a practical pattern should check

  1. Exactly one at sign, with at least one character on each side.
  2. At least one dot in the domain, and no dot immediately before or after the at sign.
  3. No spaces, and no characters that are outright illegal in an address such as angle brackets or a comma outside a quoted section.
  4. A top-level domain of at least two letters, which rejects most accidental inputs such as name@company.
  5. A sensible overall length limit. The full address may not exceed 254 characters in practice.

Cases that break naive patterns

  • Plus addressing: [email protected] is valid and widely used for filtering.
  • Dots inside the local part: [email protected], and even consecutive dots in some providers, though that is rare and provider-specific.
  • Subdomains: [email protected] is a perfectly ordinary address.
  • Long new top-level domains: [email protected] and similar are valid, so do not hard-code a list of two-letter endings.
  • Uppercase letters and internationalised domains. Both are legal; normalise case rather than rejecting it.

How to test a pattern properly

Build a three-column test set before you ship anything. Column one contains addresses that must match, including the awkward ones above. Column two contains addresses that must be rejected: missing at sign, double at signs, trailing dot, spaces, empty local part, missing top-level domain. Column three contains inputs that look like addresses but are not, such as a full sentence, a phone number or a URL. Run all three columns. A pattern that passes column one but also matches half of column three will cause more damage than no validation at all.

What to do after the regex passes

  • Normalise the domain to lowercase and trim surrounding whitespace before storing.
  • Send a verification link with a short expiry, and do not mark the account as confirmed until it is clicked.
  • Apply rate limits to the verification endpoint, or it becomes a free way to send mail through your domain.
  • Show a specific error message. "Please enter a valid email address" tells the user nothing about which part is wrong.
Test your email pattern against real cases→

Paste a pattern and a list of inputs, see instantly what matches and what does not.

Put the tutorial patterns to work instantly

Regex Tester
→
AI Regex Generator
→
All tools
→
Try 100+ ready templates in Korelyy Toolbox →
☕ Support KorelyyIf this tool helped you, buy me a coffee

Contents

  • The only authoritative check is delivery
  • What a practical pattern should check
  • Cases that break naive patterns
  • How to test a pattern properly
  • What to do after the regex passes