Skip to content
Run here 100% in your browser, no upload, no login

Regex Explainer

See what each part of a regular expression means, explained in plain language.

Highlighted pattern
What each part means

Enter a pattern above and press Explain. Escapes like \d and \b are supported.

What the flags do

The pattern is tokenized in your browser and validated with the JavaScript engine. Nothing is sent anywhere, and no text is matched — this tool only explains.

How to use it

  1. Type the pattern without the surrounding slashes, for example (\d{4})-(\d{2}).
  2. Set the flags you care about — g, i, m, s, u, y — and the flag list explains what each one does.
  3. The Highlighted pattern row colors every part by its role: anchors, classes, groups, quantifiers, alternation.
  4. The What each part means list explains each token in order, including lazy and possessive quantifier suffixes.
  5. Invalid patterns are rejected with the engine's own message, so you can see exactly what failed.

Common use cases

Why it stays private

The pattern is tokenized in your browser and validated with the JavaScript engine. Nothing is uploaded, and no text is matched against the pattern — this tool only explains, it never sees your data.

FAQ

Q: Does it test my pattern against text? A: No. It explains the pattern only. For matching and replacing, use the regex tester tool on this site.

Q: What if my pattern is valid in another language but not in JavaScript? A: The check uses the JavaScript engine, so a pattern that fails here may still work in PCRE or Python. The error message comes from that engine and says what it rejected.

Q: How are backreferences and named groups shown? A: Backreferences appear as a reference to an earlier capture group, and named groups are labeled with their name. Group contents are listed token by token, not nested visually.

Q: Are lookarounds explained? A: Yes — positive and negative lookahead and lookbehind each get their own explanation, including the fact that they match without consuming characters.

Your data stays on this device

Regex Explainer runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.