DeveloperFree · no sign-up Runs in your browser

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.

Loading the tool…

How to use the Regex Tester

  1. 1Type a pattern (or paste one like /abc/gi) and tick the flags you need.
  2. 2Paste your test text. Matches are highlighted as you type.
  3. 3Read the match list with each numbered and named group.
  4. 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.

All tools

Then schedule it with Join Postly

Plan, publish and track your posts on every network from one calendar. Free plan, no credit card.

No credit card required Free forever plan Cancel anytime