Regex Tester
Test a regular expression against sample text and see every match, its position and its groups.
Type a pattern and some test text.
How to use the Regex Tester
- Type your regular expression, without the surrounding slashes.
- Set the flags and paste some text to test it on.
- Read the table of matches. Tick the replacement box to preview a find-and-replace.
Which regex flavour is this?
The tester uses your browser's JavaScript engine, so it behaves exactly as the pattern will in JavaScript and TypeScript code. Most patterns work the same in Python, PHP, Java and other languages, but a few features — such as lookbehind support, named-group syntax and possessive quantifiers — differ between them.
Frequently asked questions
Why do I only get one match?
Without the "g" flag a pattern stops at the first match. Add g to the flags to find them all.
What do "(none)" and "(empty)" mean in a group column?
"(none)" means that group did not take part in the match. "(empty)" means it matched, but matched nothing.
Is my text sent anywhere?
No. The pattern is run in your browser.
Is what I type sent to a server?
No. This tool runs entirely in your browser, so nothing you enter leaves your device.