Regex tester

A regex tester shows which parts of a text match a regular expression and what each capture group contains. This one uses JavaScript regex syntax.

How to use the regex tester

  1. Enter the pattern without surrounding slashes.
  2. Set flags such as g, i or m.
  3. Paste test text and read the highlighted matches.

Catastrophic backtracking

Some patterns take exponential time on certain input. Matching runs in a background worker here and is stopped after one second.

Frequently asked questions

Which regex flavor is this?

JavaScript (ECMAScript). PCRE, Python and Go differ in places.

What does the g flag do?

It finds every match, not just the first.

How many matches are shown?

Up to 500 are highlighted and the first 50 listed.

Related tools