Boneyard Tools

Regex Explainer and Pattern Breakdown

Paste any JavaScript regular expression and get a token-by-token breakdown in plain English, so you can read what each character class, quantifier, group and anchor actually does. It updates as you type and never leaves your browser.

How to explain a regular expression

  1. Type or paste your pattern, without the surrounding slashes.
  2. Add any flags such as g, i or m in the flags box.
  3. Read the numbered breakdown to see what each part matches, plus a one-line summary.

Examples

A phone-number pattern

Pattern \d{3}-\d{4}
any digit, repeated exactly 3 times, the literal character -, any digit, repeated exactly 4 times

A capitalised word

Pattern ^[A-Z][a-z]+$
start of line, one A to Z, one or more a to z, end of line

Frequently asked questions

What does this regex mean?

Paste your pattern and the explainer lists each token in order with a plain-English description, so /\d{3}-\d{4}/ reads as a digit repeated three times, a literal dash, then a digit repeated four times.

Which regex dialect does it use?

It reads patterns with the JavaScript RegExp engine in your browser. Most syntax is shared with other languages, but features like lookbehind and named groups follow the ECMAScript rules.

Do I include the slashes or flags in the pattern box?

No. Type only the pattern source, for example \w+@\w+ rather than /\w+@\w+/g, and put any flags like g or i in the separate flags box.

What happens with an invalid pattern?

If the pattern or flags cannot be compiled, the tool shows an error instead of a breakdown. Fix the unbalanced bracket or bad quantifier and the explanation reappears.

Can it explain groups, lookaheads and backreferences?

Yes. It labels capture groups, named groups, non-capturing groups, positive and negative lookahead and lookbehind, alternation and numbered backreferences such as \1.

Is my regex private?

Yes. Parsing and explaining happen entirely in your browser and nothing is uploaded to a server.

Related tools