Skip to content
HQ8T

Regex Tester

Test regular expressions with live highlighting and groups.

//g
Flags

How to use

  1. 1Type your regular expression, without the surrounding slashes.
  2. 2Tick the flags you need, such as g (global) and i (ignore case).
  3. 3Paste your test text. Matches are highlighted as you type.
  4. 4Check capture groups in the table, and try a replacement at the bottom.

Frequently asked questions

Which regex flavour is this?

JavaScript (ECMAScript), as used in browsers and Node.js. Most syntax is shared with other languages, but lookbehind and named groups follow JavaScript rules.

What do the flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, and u enables full Unicode (useful for Hindi and emoji).

How do I use groups in a replacement?

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

Why did my regex stop with “took too long”?

Some patterns, like (a+)+ on long text, take exponentially long. The tester stops after one second so your browser doesn't freeze. Try a more specific pattern.

Is my text sent anywhere?

No. Everything runs in your browser.