Skip to content
M2TOOLKIT

Developer · free tool

Regex Explainer

Understand any regular expression, one piece at a time.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Nothing is sent or stored
  • Updated
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.

Use cases

  • Understand a regex someone else wrote.
  • Review validation patterns before shipping them.
  • Learn regex syntax step by step.

^\d{3}-\d{4}$ in plain English

^ start of the text · \d{3} exactly three digits · - a hyphen · \d{4} exactly four digits · $ end of the text. It matches “555-1234” but not “555-12345”.

Common mistakes

  • Forgetting ^ and $, so the pattern matches part of a longer string.
  • Using greedy .* where a lazy .*? was intended.
  • Not escaping dots — . matches any character.

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.

Frequently asked questions

Which regex flavour does it use?

JavaScript's, through your browser's own regex engine.

Can I paste /pattern/flags?

Yes, slashes and flags are recognised.

How do I test it on real text?

Use the Regex Tester to see the matches live.

Content last updated . See how M2Toolkit works.

Other tools people use alongside the regex explainer.