Regular expressions, explained and debuggable
A regular expression is a tiny program that matches text: literals, character classes, quantifiers, groups, anchors. Powerful enough to validate an email in one line, cryptic enough that nobody wants to maintain that line six months later.
Regexes fail silently — the pattern compiles, matches nothing, and you stare. The fix is a fast feedback loop: live highlighting of every match, numbered and named capture groups laid out per match, and a token-by-token explanation of what your pattern actually says.
Open the free RegEx Tester — no signup, runs entirely in your browser.
How to use it
- Type your pattern and paste the text to test against.
- Toggle flags — global, ignore case, multiline, dotall, unicode, sticky.
- Inspect highlighted matches and capture groups; read the pattern explanation.
Why this one
- Live match highlighting as you type — no run button.
- Numbered and named capture groups with exact match ranges.
- All six JavaScript flags: g, i, m, s, u, y.
- A pattern explainer that translates your regex back into English.
Frequently asked questions
What do regex flags do?
Flags change matching behavior: i ignores case, m makes ^ and $ match per line, s lets the dot match newlines, g finds all matches instead of the first, u enables full Unicode, y anchors at the last position.
Greedy vs lazy quantifiers — what is the difference?
Greedy (the default) takes as much as possible, then backs off until the rest matches. Lazy — a ? after the quantifier — takes as little as possible. .* grabs everything; .*? stops at the first valid end.
What is a capture group?
Parentheses around part of a pattern both group it and capture what it matched — addressable by number, or by name with (?<name>...). That is how you extract the domain from a URL instead of just matching it.