FREE TOOL · ON YOUR DEVICE
Regex tester online for free
Type a pattern and some test text and you instantly see what matches, with each capture group in a table. Turn on flags such as g, i, m or s and try a replacement with $1 or $<name>. It uses your browser’s JavaScript regular expression engine, without sending anything.
- Free with an account
- JavaScript flavour
- Groups and replace
- Type the pattern and the text
- Choose the flags
- Review and replace
HOW TO USE IT
Three steps.
Type the pattern and the text
The pattern goes without slashes, for example \d+ to find numbers. The test text can be up to 200,000 characters.
Choose the flags
g finds every match, i ignores case, m and s change how ^, $ and the dot work. Each flag is explained next to its checkbox.
Review and replace
Matches are highlighted in the text and groups appear in a table. Type a replacement with $1 or $<name> to see the result and copy it.
NEXT STEP
Keep going with these tools
Regex tester: common questions
Which regex flavour does it use?
JavaScript (ECMAScript), with your browser’s engine: it matches what your JavaScript code will do. It can differ from PCRE, Python or Java in details such as possessive quantifiers, \A and \Z or POSIX classes.
Why did the search stop?
If a pattern takes more than 2 seconds, it is stopped so the page does not freeze. This usually comes from catastrophic backtracking, as in (a+)+$: avoid nested quantifiers that match the same thing.
How many matches does it show?
Up to 1,000 highlighted and in the table; if there are more, you see a notice. The replacement applies to the whole text: to every match with the g flag, or only the first without it.
Is my text sent to a server?
No. Everything is calculated in your browser as you type; the text is not sent to Cocuyo or any third party and is not stored. You can check it in your browser’s network tools: your file is not sent.
Is it really free?
Yes. You can try it before signing up; to keep using it, we ask for a free account, with no subscription. It uses no credits and does not count toward your 30 welcome uses: it has no usage cap.
MORE FREE TOOLS
Other text tools
All free tools
WHEN YOU WANT TO CREATE
Make new images with AI.
Cocuyo’s Studio brings 30+ AI models for image, video and voice together. You see the credit cost before generating, and credits never expire.