Regex Explainer
Paste any regular expression and get a plain-English breakdown of every token.
Type a regex above or click a sample to get started.
What Is a Regex Explainer?
A regex explainer breaks a regular expression down into its individual tokens and describes each one in plain English. Instead of memorizing every escape sequence and quantifier, you can paste any pattern and immediately understand what each part does — anchors, character classes, groups, lookaheads, quantifiers, and flags included.
How to Use
- Type or paste a regex in
/pattern/flagsformat or as a bare pattern. - Each token is highlighted and explained below instantly.
- Click a Sample button to load a common real-world pattern.
- Color coding: purple = anchor, blue = character class, orange = quantifier, green = group, cyan = special, gray = literal.
Key Features
- Supports anchors, character classes, quantifiers, groups, lookaheads/lookbehinds
- Explains all common escape sequences: \d, \w, \s, \b, \n, \t, hex, unicode
- Handles named capture groups, non-capturing groups, back-references
- Lazy vs greedy quantifier distinction
- All 7 JavaScript regex flags explained
FAQ
Does this validate whether my regex is correct?
Yes — the tool tries to compile the regex using JavaScript's native RegExp. If it throws a SyntaxError, the error is shown at the top.
What regex flavor does this tool use?
JavaScript (ECMAScript) regex syntax. Most patterns are compatible with Python, Java, and Go, but some features like named groups have different syntax in older engines.
How do I test whether my regex matches a string?
Use the Regex Tester tool to test patterns against sample text with live match highlighting.