Regex tester for JavaScript
Write a JavaScript regular expression and see every match highlighted in your test text as you type, with numbered and named groups and a replace preview. Each run happens in a separate worker with a time limit, so a runaway pattern can't freeze the page.
How to use the Regex Tester
- 1Type a pattern (or paste one like /abc/gi) and tick the flags you need.
- 2Paste your test text. Matches are highlighted as you type.
- 3Read the match list with each numbered and named group.
- 4Type a replacement such as $1 or $<name> to preview the replaced text, then copy it.
Frequently asked questions
Which regex flavour does this tester use?
Your browser's own JavaScript engine, so results match what your code will do in a browser or Node.js, including named groups, lookbehind and \p{…} Unicode classes with the u flag.
What is catastrophic backtracking?
Patterns with nested repetition, like (a+)+$, can take exponentially long on some inputs. Here each run happens in a worker that is stopped after 1.5 seconds, and you see a warning instead of a frozen tab.
Why does my pattern only find the first match?
Without the g (global) flag, JavaScript stops at the first match. Tick g to find them all.
How do I use capture groups in the replacement?
Use $1, $2 and so on for numbered groups, $<name> for named groups, $& for the whole match and $$ for a dollar sign.
Related free tools
All tools- CSV to JSON ConverterConvert CSV to JSON and JSON to CSV, with quotes handled properly.
- JSON Formatter & ValidatorBeautify, validate, minify and explore JSON, with exact error lines.
- URL Encode & DecodePercent-encode or decode URLs and query strings.
- Diff CheckerCompare two texts line by line or word by word.
Then schedule it with Join Postly
Plan, publish and track your posts on every network from one calendar. Free plan, no credit card.