Regex Explain

Break down a regex pattern into color-coded tokens with plain-language explanations for each part.

Input data is processed in your browser
Data is never sent to a server

Tool

or drag & drop a file

Try an example

What is Regex Explain?

Regex Explain breaks a regular expression down into its individual tokens, color-codes each one by type, and provides a plain-language description of what each part does.

Hover over any token in the colorized view to highlight its corresponding explanation. Built-in examples for email, date, URL, IPv4, and hex color patterns let you explore real-world regular expressions instantly.

How to Use

  1. Enter a regex pattern in the input field (no slashes needed).
  2. Toggle flags (g, i, m, s) with the flag buttons.
  3. The colorized view shows each token highlighted by type.
  4. The explanation list describes what each token does.
  5. Optionally enter a test string to see match highlights.

FAQ

Which regex components are recognized?

Anchors (^ $ \b \B), quantifiers (* + ? {n,m} and their lazy variants), capture groups (named, non-capturing, lookahead, lookbehind), character classes ([...]), escape sequences (\d \w \s etc.), the dot metacharacter, alternation (|), and literal characters.

How are greedy vs lazy quantifiers shown?

Quantifiers followed by ? are described as lazy (shortest match), while those without ? are described as greedy (longest match).

Can it handle nested groups?

Yes. The tokenizer processes the pattern left-to-right, so nested groups are each tokenized and explained individually. Structural validity is checked by the JavaScript RegExp engine.

Is my data sent to a server?

No. All processing happens entirely in your browser.