Toolbox

Regex Tester

Test JavaScript regular expressions with live highlighting and groups.

  • Free, no sign-up
  • Files stay on your device
  • Works offline
Loading tool…

How to use the Regex Tester

  1. 1

    Type your regular expression and choose flags such as g (global) or i (ignore case).

  2. 2

    Paste a test string. Every match is highlighted as you type.

  3. 3

    Inspect each match's position, capture groups and named groups.

  4. 4

    Optionally enter a replacement to preview the result of String.replace.

Frequently asked questions

Everything you need to know about the Regex Tester.

Which regex flavor does this use?

It uses your browser's JavaScript (ECMAScript) regex engine, so results match exactly what your JavaScript or TypeScript code will do.

What do the flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables Unicode mode and y (sticky) matches only at the current position.

How do I reference groups in the replacement?

Use $1, $2 and so on for numbered groups, $<name> for named groups and $& for the entire match.

Why does my pattern show only one match?

Without the g flag a regular expression stops after the first match. Turn on g to find every match.