Tool · Text & data
Test a regular expression
Write a pattern against real sample text and see every match and capture group as you type. The text you test against never leaves this page.
- Your text goes to
- Works offline
- Yes, once it has loaded
- Account
- None, and it is free
- Handles
- JavaScript regular expressions
How to test a regular expression
-
01Write a pattern
Pick the flags you need, or start from one of the common patterns in the sidebar.
-
02Paste the text to test against
Matches are highlighted as you type, with every capture group listed.
-
03Try a replacement
Type a replacement with $1, $2 or a named group and see the result straight away.
Questions about Regex Tester
Which regex flavour does it use?
JavaScript’s, as built into your browser, with the g, i, m, s and u flags.
Can I test a replacement?
Yes. Type a replacement using $1, $2 or a named group, and the replaced text is shown under the matches.
What happens if my pattern never finishes?
Nested quantifiers such as (a+)+$ can take practically forever on text that does not match. A match still running after 1.2 seconds is stopped rather than left to freeze the page.
Is my test text uploaded?
No. This page is served with a security policy that forbids it from making any network request, so the browser itself refuses to send your text anywhere. You can watch your browser's network tab stay empty, or switch your connection off and carry on.