Skip to content
M2TOOLKIT

Regex Explainer

Understand any regular expression, one piece at a time.

  • Free
  • No sign-up
  • Nothing is sent or stored
Examples:

What it matches

  1. ^start of the line (or string)
  2. [\w.+-]one of: any word character (letter, digit or underscore), “.”, “+”, “-”
  3. +…repeated one or more times
  4. @the character “@”
  5. [\w-]one of: any word character (letter, digit or underscore), “-”
  6. +…repeated one or more times
  7. \.a literal “.”
  8. [\w.]one of: any word character (letter, digit or underscore), “.”
  9. +…repeated one or more times
  10. $end of the line (or string)

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved.

How to use the Regex Explainer

  1. Paste a regex (with or without /slashes/ and flags).
  2. Read the explanation for each token.
  3. Try the examples to learn common patterns.

What does this tool do?

Regular expressions are compact but cryptic. The explainer splits a pattern into tokens — anchors, character classes, groups, quantifiers and escapes — and describes what each one matches, indenting the contents of groups.

It also checks the pattern with your browser's regex engine and reports syntax errors. Test it against real text with the Regex Tester.

Why use it?

  • Plain-English breakdown.
  • Groups shown as nesting.
  • Syntax check included.

Privacy

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the regex explainer.