Regular Expression Tester
See every match and capture group, safely.
Everything is processed in this tab. Nothing you paste is sent anywhere.
Every tool runs entirely in your browser. Your files are never uploaded to a server.
A regular expression describes a pattern of characters. Testing one shows which parts of your text it matches, where each match starts, and what each parenthesised group captured.
How to use Regex Tester
- Write your pattern. On the first line, without surrounding slashes.
- Add a --- separator. Then paste the text you want to test it against underneath.
- Set the flags. Ignore case, multiline and dot-matches-newline are toggles.
- Read the matches. Each one with its position and every capture group.
About testing a regular expression
A regular expression is a small language for describing patterns in text, and the reason testing one interactively helps so much is that reading a pattern back rarely tells you what it does. The gap between what a pattern was intended to match and what it actually matches is where nearly all regex bugs live, and the fastest way to close it is to run it against real text and look at the results. Capture groups are worth understanding properly because they are what turns matching into extracting. Each pair of parentheses stores what it matched, numbered by the position of its opening bracket, so nested groups can be counted wrongly if you read them from the inside out. A group that takes part in the pattern but never matches — because it sat behind an alternation that was not taken — reports as undefined rather than as an empty string, and the difference matters when the result feeds into code. Two practical cautions. Flags are not decoration: the multiline flag changes only what the anchors mean and does nothing to the dot, which trips people who expect it to make a pattern span lines when they want the separate dot-all flag instead. And patterns with nested quantifiers can backtrack catastrophically, taking exponential time to conclude a string does not match. That behaviour is the basis of a genuine denial-of-service class, which is why the match count here is capped rather than allowed to run unbounded in your tab.
Frequently asked questions
Should I include the slashes around my pattern?
What is a capture group?
What does the multiline flag actually change?
Why is my regex slow or hanging elsewhere?
Is this the same regex flavour as Python or PCRE?
Last updated