Regex Tester & Explainer
Test regular expressions with live match highlighting. Match mode shows capture groups and allows navigation between matches. Substitution mode shows replacement results. List mode extracts all matches one per line. When nothing matches, the "Why didn't it match?" panel gives specific reasons.
Regex Is Easier Than It Looks
A regular expression is just a search pattern with a syntax that intimidates people at first glance. Once you know that \d means any digit, + means one or more, and () captures a group — most patterns become readable. Type your pattern above and the Plain-English Explanation panel breaks it down token by token as you type.
Three Modes
- Match — highlights every occurrence in your test string. Match Details below shows each match with its position and any captured group values. Use the ▲▼ buttons to navigate between matches when there are many.
- Substitution — shows what the text looks like after replacing all matches. Use
$1,$2to insert captured group values, or$&for the whole match. - List — extracts every match and outputs them one per line, nothing else. Useful when you want to pull a clean list of values from a document without the surrounding text.
Why Didn't It Match?
When your pattern finds no matches, the "Why didn't it match?" panel activates automatically. It checks for the most common silent failures: case mismatch (the pattern would match with the i flag), anchors that are too strict (^ and $ requiring the entire string to match), Windows line endings interfering with $, and unescaped dots that may not be doing what you think.
The Four Flags
g (global) — find every match, not just the first. Almost always want this on. i (case insensitive) — hello matches Hello, HELLO, hElLo. m (multiline) — makes ^ and $ match the start and end of each line, not just the whole string. s (dotAll) — makes . match newline characters too, useful when your pattern needs to span multiple lines.