Copied!
Code Tool

Regex Explainer Online

Translate any regular expression into plain English with a color-coded breakdown of every token. This free regex to plain English translator parses capture groups, quantifiers, character classes, lookahead and lookbehind assertions, anchors, alternation, and more. Paste a regex pattern to instantly visualize its structure — a powerful regular expression breakdown tool for understanding complex pattern matching. All processing runs client-side in your browser.

regex-explainer.tool
Enter a regex pattern above to see a plain English explanation.

Frequently Asked Questions

How do I read a regular expression?
Read a regex left to right, breaking it into tokens. Literal characters match themselves. Special sequences like \d, \w, and \s match character classes (digits, word characters, whitespace). Quantifiers like *, +, and ? control how many times the preceding token repeats. Anchors like ^ and $ mark the start and end of the string. Parentheses () create capturing groups, and square brackets [] define character sets. Use this regex explainer tool to instantly translate any pattern into plain English.
What does \d, \w, and \s mean in regex?
These are shorthand character classes: \d matches any digit (0–9), equivalent to [0-9]. \w matches any word character (letters, digits, underscore), equivalent to [a-zA-Z0-9_]. \s matches whitespace (space, tab, newline). Their uppercase counterparts \D, \W, \S match the opposite — non-digit, non-word character, and non-whitespace respectively. The dot . matches any character except newline (unless the s flag is set).
What is the difference between * and + in regex?
Both are quantifiers. The asterisk * means "zero or more" — the preceding element may appear any number of times or not at all. The plus + means "one or more" — the preceding element must appear at least once. For example, \d* matches an empty string or any sequence of digits, while \d+ requires at least one digit. Add ? after either (*?, +?) to make them lazy, matching as few characters as possible instead of as many.
How do capturing groups work in regular expressions?
Capturing groups are created with (). They group parts of a pattern together (to apply quantifiers or alternation) and capture the matched text for backreferences (\1, \2) or replacement strings ($1, $2). Non-capturing groups (?:...) group without saving the match, which is more efficient. Named groups (?<name>...) allow referencing by name instead of number. Groups are numbered left to right by their opening parenthesis.
What are lookaheads and lookbehinds in regex?
Lookaheads and lookbehinds are zero-width assertions — they check if a pattern exists without consuming characters. (?=...) is a positive lookahead: it asserts that what follows matches the pattern. (?!...) is a negative lookahead: asserts what follows does NOT match. (?<=...) is a positive lookbehind: checks what precedes. (?<!...) is a negative lookbehind: asserts the preceding text does NOT match. They are essential for complex pattern matching like password validation or extracting text between delimiters.