//g
  • 100% Free
  • No Sign-Up
  • No Credit Card
  • No Free Trial
  • No Pro Tier
  • No Watermarks

Nothing is uploaded. Just open it and start.

Email Address Regex

A practical check that text looks like an email address: a name, an @, a domain and a top-level domain of two or more letters.

/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/

Piece by piece

  1. ^the start of the text
  2. [A-Za-z0-9._%+-]+one of A–Z, a–z, 0–9, “.”, “_”, “%”, “+”, “-”, repeated 1 or more times, as many as possible
  3. @the character “@”
  4. [A-Za-z0-9.-]+one of A–Z, a–z, 0–9, “.”, “-”, repeated 1 or more times, as many as possible
  5. \.the character “.”
  6. [A-Za-z]{2,}one of A–Z, a–z, repeated 2 or more times, as many as possible
  7. $the end of the text

Examples

TextResult
name@example.comMatches
first.last+tag@mail.example.co.ukMatches
x_y%z@sub-domain.orgMatches
name@Doesn't match
@example.comDoesn't match
name@exampleDoesn't match
two words@example.comDoesn't match
  • It doesn't accept every address the standard allows (quoted names, IP-address domains, non-Latin domains).
  • Matching the shape doesn't prove the mailbox exists; only sending an email does.

Other common patterns

Test any regular expression →

Frequently asked questions

How do I use this email address regex in JavaScript?
Write it as /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/ and call re.test(text). It is anchored with ^ and $, so it checks the whole text; remove them to find it inside longer text (and add the g flag to find every one). The Code view writes it out for Python, Go and PHP too.
Is it a complete validator?
No regex is the whole story. It doesn't accept every address the standard allows (quoted names, IP-address domains, non-Latin domains). Matching the shape doesn't prove the mailbox exists; only sending an email does.
Can I try it on my own text?
Yes. The tester above already holds the examples; paste your own text over them and every match is highlighted as you type. Nothing is uploaded.

Spotted a bug or have a suggestion?

Found something broken, have an idea, or just want to say thanks about any of our tools? Every message reaches a real person.