Plain-English breakdown · runs in your browser
Regex Explainer
How to read the explanation
The explainer walks the pattern from left to right and describes each token in the order the engine meets it. Tokens inside a group are indented under it, so you can see which quantifier applies to which part. A one-sentence summary at the top says what the whole pattern looks for.
Change the pattern and the explanation updates as you type. If the pattern has a syntax error, the error is shown with a suggested fix instead of a half-finished explanation.
Explanations for your language, not just JavaScript
Pick Python, PHP, Java, Go, C#, Rust or Ruby in the top bar and the pattern is converted for that language first. The explainer then describes the converted pattern, and the compatibility banner tells you when a token does not exist in that language. For example, Go has no lookbehind and Python writes named groups as (?P<name>...).
What an explanation cannot tell you
An explanation describes the shape a pattern accepts. It cannot tell you whether that shape is the right one for your data. In the sample above, the month group only allows 01 to 12, but \d{2} for the day accepts any two digits, so the test text shows the impossible date 2026-02-40 being matched. Always test with a few strings that should fail as well as ones that should pass.
Frequently asked questions
- Is the explanation written by an AI?
- No. RegexLab parses the pattern with its own parser and builds the explanation from the parsed tokens, so the same pattern always gets the same explanation and nothing is sent to an AI service.
- Can it explain very long patterns?
- Yes, patterns up to 5,000 characters are accepted. For long patterns, turn on the Diagram as well; seeing the structure as a picture is often faster than reading every line.
- Does it support lookbehind, named groups and Unicode classes?
- Yes. Lookahead, lookbehind, named and non-capturing groups, backreferences, lazy quantifiers and \p{...} Unicode properties are all recognised and described.