Regex Explainer (Plain English)

Understand a regular expression you did not write by reading what each part matches.

Use the tool

Why this tool exists

The explainer parses the pattern the way the engine does and describes literals, escapes (\d, \w, \b, \p{...}, backreferences), character classes with ranges, anchors, groups (capturing, named, non-capturing), lookahead and lookbehind, alternation and quantifiers including lazy ones. Groups are indented so you can see the structure. Invalid patterns are reported with the engine's message.

It explains JavaScript syntax; other flavours differ in small ways. The explanation says what the pattern matches, not whether it is a good idea: complex patterns for email or HTML are better replaced with a parser.

No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.

How to use it

  1. Paste the pattern, with or without /slashes/flags.
  2. Read the indented explanation.
  3. Test the pattern in the regex tester.
  4. Simplify anything you cannot explain.

Frequently asked questions

Which regex flavour is explained?

JavaScript (ECMAScript), including named groups, lookbehind and Unicode property escapes.

Does it find performance problems?

No. The regex benchmark simulator helps there.

Can it explain PCRE or Python patterns?

Mostly, when they use shared syntax, but flavour-specific features such as possessive quantifiers are noted as unsupported.

Is my data sent anywhere?

No. Everything is processed in your browser, and the page makes no network requests with your input.