Regex Tester
Write a pattern, paste your text, and see matches light up as you type — with capture groups listed and the common tokens translated into plain English.
Matches and groups
What the tokens mean
Built for the Way Regex Is Really Written
Nobody writes a correct regular expression on the first attempt — the workflow is guess, test, adjust. This page shortens that loop: the pattern runs on every keystroke, matches are highlighted in place so you can see where it matched and, just as usefully, where it stopped matching, and each match is listed with its capture groups underneath. A pattern error shows the browser's own message in red rather than failing silently, because "no matches" and "broken pattern" are very different problems.
The Handful of Tokens That Do Most of the Work
Most everyday patterns are built from a small kit: . any character, \d digit, \w word character, \s whitespace, * zero or more, + one or more, ? optional, [a-z] a character class, ^ and $ start and end, and (…) a capture group. The explainer under the results translates the tokens in your current pattern into these plain meanings, in order — a fast way to read a pattern someone else wrote, which is the other half of regex work.
Dialects Differ — This One Is JavaScript
Regular expressions are a family, not a single language. This tester uses the JavaScript dialect, since it runs in your browser. Patterns usually port to Python, PHP or Java with small changes, but look out for dialect features: named groups, lookbehind support, and escaping rules inside character classes vary, and POSIX tools like grep have their own older dialect entirely. Test the ported pattern in its real home before shipping it — and keep a few sample strings, including ones that should not match, with the code.
Frequently Asked Questions
Which regex dialect does this tester use?
JavaScript, because it runs in your browser. Most patterns port to Python, PHP or Java with minor changes, but check dialect features like lookbehind and named groups in the target language.
Why does my pattern match nothing?
Either the pattern has an error (shown in red above the results), or it genuinely does not match — check escaping first: a literal dot needs \. and many testers fail on an unescaped slash or bracket.
What is a capture group?
A part of the pattern in parentheses. Whatever it matches is reported separately — the tester lists each group under its match, which is how you extract pieces like the domain from an email address.
Why did highlighting stop after the first match?
Your flags do not include g (global). Without it, a regex finds only the first match. Choose a flags option with g to highlight and list them all.