Regex explain

Paste a regular expression and read it back as plain English, token by token.

Runs in your browser — nothing you type here is sent anywhere.
Pattern
//
Presets
7
tokens

Anchored at both ends, so the entire subject has to match. No capturing groups. Flags: ignores case.

literal/^[\w.+-]+@[\w-]+\.[a-z]{2,}$/i
Watch out
  • Inside a character class "." is just a full stop — "[.]" matches a dot, not any character. Outside a class it still means anything.
Reading order
^the start of the subject
[\w.+-]+one or more of a word character, a full stop, a plus sign, or a hyphen
@a literal at sign
[\w-]+one or more of a word character or a hyphen
\.a literal full stop
[a-z]{2,}2 or more of "a" to "z"
$the end of the subject

Read top to bottom — each line consumes the next slice of the subject. Indentation is nesting: everything indented under a group belongs inside it, and a lookaround consumes nothing, it only checks.

Inheriting a long pattern full of lookaheads and non-capturing groups is a genuine reading problem. The pattern is correct or it is not, and you cannot tell which without decoding it piece by piece.

Each token is broken out and described in order — what it matches, how it repeats, whether it captures — so a wall of punctuation becomes a list of statements you can check against what the pattern is supposed to do.

What people open it for

In the terminal

tools regexplain

Every utility is also a command in the desktop's shell.

More text tools

Open the full desktop, with all 47 utilities