Regex Explainer
break down a regex pattern into plain English with visual diagrams
By Bikram NathLast updated
Paste any regular expression to get a labeled plain-English breakdown of every token plus a railroad diagram showing the match path. For example, `^(?<year>\d{4})-\d{2}$` comes back with separate explanations for the start anchor, the named capture group, the digit quantifier, and the end anchor. The railroad diagram is what distinguishes this from a text-only description: it makes alternation branches and optional groups visually unambiguous.
Try it now — free, instant, no signup
What is Regex Explainer?
The tool parses a regex into its constituent tokens and returns a plain-English label for each one. Enter `(https?)://([^/]+)` and you see the first group described as "captures either 'http' or 'https'", the escaped slash identified as a literal character, and the second group explained as "everything that is not a forward slash". A railroad diagram renders alongside so you can trace the match path visually.
regex101 is the right choice when you need to test whether a pattern matches sample text. This tool fills a different gap: the regex already exists and the question is what it does. Regexper produces a visual railroad diagram but no accompanying text. The combination here is useful when you need to explain inherited or third-party regex in a code review comment without rewriting the pattern from scratch.
The parser uses the ECMAScript regex grammar, not PCRE. Patterns lifted from Python or PHP codebases often rely on `(?P<name>...)` named groups, possessive quantifiers like `a++`, or atomic groups `(?>...)`, none of which are valid ECMAScript syntax. Those will either produce a parse error or be silently misread. Convert named groups to `(?<name>...)` and strip possessive quantifiers before pasting.