Email Validation Regex Explained

No regex validates every legal email address, but this practical one catches typos. See exactly what it accepts.

AI DevRuns in your browser — nothing uploaded

Flags

What it means

Looks like it matches an email address.

  1. ^Start of the text
  2. [\w.+-]+One or more × one of: word character (letter, digit or _), “.”, “+” or “-”
  3. @The character “@”
  4. [\w-]+One or more × one of: word character (letter, digit or _) or “-”
  5. \.The character “.”
  6. [\w.]+One or more × one of: word character (letter, digit or _) or “.”
  7. $End of the text

Test cases

Should match

  • fUZtv@493x.fIKb
  • mU@e.Z
  • b@vl.9
  • Gr.kL@660E.z
  • e8i@2B.H9p

Should not match

  • fUZtv@493x.fIKb!
  • ␣fUZtv@493x.fIKb
  • (empty)
  • mU@e.
  • mU@e.Z!

How it works

  1. 1

    Parses the pattern

    The regex is broken into its parts — characters, classes, groups, quantifiers, anchors and lookarounds.

  2. 2

    Explains each part

    Every piece is described in plain English, nested the same way as the pattern, so groups and alternatives stay readable.

  3. 3

    Generates test cases

    Random strings are generated from the pattern and checked against it, then mutated to find near-misses that fail.

  4. 4

    Recognises common formats

    If a pattern matches a known format — PAN, GSTIN, email, Indian mobile number, PIN code, IFSC — it says so.

Questions, answered

JavaScript. Most everyday Python, Java and PCRE patterns use the same syntax, so they explain correctly too. Features unique to other flavours (like possessive quantifiers) may not.

Popular uses