Test a regular expression
Regex Tester runs your pattern against sample text as you type, lists each match with its position and capture groups, and generates the equivalent JavaScript or Python snippet so there is nothing to retype.
- Free
- No sign-up
- Runs in your browser
- Nothing uploaded
Runs entirely in your browser — nothing you enter is uploaded.
How to use Regex Tester
Three steps, about a minute.
-
1
Write a pattern
Type the expression without the slashes.
-
2
Paste test text
Matches are highlighted immediately.
-
3
Copy the snippet
Take the working code into your project.
Regex Tester questions
Which regex flavour is this?
JavaScript (ECMAScript). Most syntax matches Python and PCRE, but lookbehind, named groups and \p{…} differ slightly — the Python snippet shows the portable form.
Why does my pattern match too much?
Quantifiers are greedy by default. Add ? to make them lazy (.*? instead of .*), or anchor the pattern with ^ and $.
How do I avoid backtracking blow-ups?
Avoid nested quantifiers like (a+)+ on long input. Prefer explicit character classes and test against the longest real input you expect.