Regex Tester
Test regular expressions live with highlighted matches and groups.
Regex Tester
Developer tool running locally in browser
What does Regex Tester do?
Write a regular expression and see matches highlighted in your test text as you type. Capture groups are listed per match, replacement output previews live, and a reference panel explains the syntax.
How to Use Regex Tester
- 1Enter your patternWithout the surrounding slashes.
- 2Set the flagsGlobal and case-insensitive are the usual choices.
- 3Paste test textMatches highlight instantly.
- 4Inspect the groupsEvery capture group is listed per match.
Key Features
- Live match highlighting as you type
- All JavaScript flags: global, case-insensitive, multiline, dotall, unicode and sticky
- Numbered and named capture groups listed per match
- Replacement preview with $1 and named group references
- Built-in syntax reference and common pattern library
- Guards against catastrophic backtracking on pathological patterns
Frequently Asked Questions
Which regex flavour does this use?
JavaScript (ECMAScript). Most syntax is shared with PCRE, Python and Java, but there are differences — JavaScript has no possessive quantifiers or recursion, and lookbehind support arrived relatively recently.
What is a capture group?
Any part of the pattern in parentheses. Its matched text is captured separately and can be referenced as $1, $2 and so on in a replacement. (?<name>…) creates a named group, referenced as $<name>.
Why is my regex extremely slow?
Catastrophic backtracking, usually from nested quantifiers such as (a+)+ against a long non-matching string. The engine explores exponentially many paths. Rewrite to avoid nesting quantifiers over the same characters.
What does the global flag do?
It finds every match rather than stopping at the first. Without it, replace only changes the first occurrence — the single most common regex surprise.
Input is processed in your browser and never transmitted. That said, treat any web page as untrusted for live production secrets — rotate anything you paste anywhere.
Related Tools
Find and Replace Text
Search and replace across text, with regular expression support.
Text Cleaner
Strip formatting, HTML, smart quotes and invisible characters.
JSON Formatter
Format, validate and explore JSON with precise error reporting.
Sort Lines
Sort a list alphabetically, numerically, by length or randomly.
