Regular expressions are dense: a few characters can mean a whole paragraph of rules, and reading someone else's pattern feels like decoding a puzzle. This free regex explainer translates any JavaScript pattern into a plain-English list, one line per token, so you can see what each piece does without memorising the syntax.
Paste a pattern and the breakdown appears, with groups indented and quantifiers spelled out. If you want to test the pattern against real text next, the Regex Tester highlights the matches, and the Regex Validator checks a pattern for syntax errors first.
How to use
- Paste a regular expression into the box.
- Add flags if the pattern uses any, then click Explain.
- Read the line-by-line breakdown, with groups indented.
- Load the sample to see a date pattern explained.
Why use Toolsvine
Most regex tools are built for writing patterns, not reading them. This explainer is the other way round: it assumes the pattern exists and your job is to understand it, which is the situation every developer lands in when they inherit code. It runs entirely in your browser, is free, and needs no account.
What does the explainer do?
The explainer walks a pattern from left to right and describes each piece in plain words: anchors like ^ and $, character classes like [A-Za-z], escapes like \d and \w, and quantifiers like *, + and {2,4}. Every token gets its own line in the result.
A quantifier is always attached to the thing it repeats, so \d+ reads as "a digit, one or more times".
Groups are the part that matters most. A capturing group is labelled with its number and indented, a non-capturing group is marked as such, a named group shows its name, and lookarounds are described by what they assert instead of what they consume. The result reads like a recipe for the pattern, in the order the engine reads it.
How do I read a character class?
A character class is a set of characters in square brackets, and the explainer spells out what is inside: ranges are named as ranges — "the range a to z" — escapes are named as what they match — \d is "a digit" — and a caret at the start flips the meaning to "any character except".
Single characters are listed one by one.
So [A-Za-z0-9_] is the set of letters, digits and underscore, which is also what \w means, and [^0-9] is any character that is not a digit. Knowing the class read aloud is the fastest way to spot a class that accepts more — or less — than its author intended.
What does a worked example look like?
Take the date pattern ^(\d{4})-(\d{2})-(\d{2})$. The explainer reads it as: start of the text; a capturing group, group 1, of four digits — the year; a literal hyphen; group 2, two digits — the month; another hyphen; group 3, two digits — the day; then end of the text.
That breakdown is also a debugging aid. If a date like 2026-11-12 fails to match, the lines show the fault immediately: the pattern needs exactly four digits, a hyphen, exactly two digits, a hyphen and exactly two digits. A date written 2026-1-2, with one-digit month and day, fails on the \d{2} groups — and now you know which groups to loosen.
What is a nested-quantifier warning?
Sometimes a pattern repeats a group that already contains a quantifier, like (a+)+, and the explainer flags it. That shape can be catastrophically slow on long text that does not match, because the engine tries an exponentially growing number of ways to split the text — a problem called catastrophic backtracking.
The warning is a warning, not an error: the pattern still compiles and still matches. But if a pattern like that ends up on a hot path — validating input on a busy form, for example — it can hang the page. Simplify the inner quantifier, or use an atomic group if your engine supports one, and the danger goes away.
Frequently asked questions
What does \d mean in a regex?
It means a digit, 0 through 9. The explainer spells out every escape like that: \w is a word character — a letter, digit or underscore — \s is whitespace, \b is a word boundary, and a capital letter is the opposite, so \D is a non-digit. Escapes exist so a pattern can say digit without writing out [0-9] every time, and this tool translates them back into the plain words.
What is the difference between * and +?
The star means zero or more times, so the thing before it may be absent entirely; the plus means one or more times, so at least one occurrence is required. The question mark means zero or one time, making the thing optional. For exact counts, braces work: {3} is exactly three, {2,4} is two to four, and {2,} is two or more.
What is a capturing group?
It is a part of the pattern in parentheses that the engine remembers after a match, numbered from the first opening parenthesis. In ^(\d{4})-(\d{2})-(\d{2})$, group 1 is the year, group 2 the month and group 3 the day. A non-capturing group groups without remembering, and a named group remembers under a name instead of a number.
What is a lookahead?
A lookahead asserts that something follows — or does not follow — without consuming it. (?=...) means the following text must match, (?!...) means it must not. (?=.*[A-Z]) in a password pattern demands a capital letter somewhere ahead, while the match itself can continue anywhere. Lookbehinds do the same for the text before.
Why does the explainer warn about nested quantifiers?
Because a quantifier inside a repeated group, like (a+)+, can make matching catastrophically slow on text that does not match: the engine tries an exponentially growing number of splits. The pattern still works, but on a busy form it can hang the page. Simplify the inner quantifier or use an atomic group, and the danger goes away.
Can the explainer handle any regex?
It handles the common JavaScript syntax — anchors, classes, escapes, quantifiers, groups, lookarounds and flags — and reports a plain error for anything it cannot read, like an unterminated class or a backslash at the very end. Backreferences are the one deliberate gap: the tool explains the group but says it does not explain backreferences, rather than guessing.