Regex tester

Test a regular expression and see every match and group.

  • Development
  • 100% free
  • No sign-up
  • Runs in your browser
Regex tester

What is the regex tester?

The regex tester runs a JavaScript regular expression against a test string and highlights every match while you type. Each match is listed with its position, numbered capture groups and named groups, and you can preview a replacement with references such as $1 or $<name>.

All the flags are supported: g (global), i (ignore case), m (multiline), s (dot all), u (unicode), v, y (sticky) and d (indices).

How to use the regex tester

  1. 1Type the regular expression and the flags.
  2. 2Paste the test string.
  3. 3Read the matches and groups, and add a replacement to preview it.

Features

Live highlighting

Matches are highlighted as you type.

Groups

Numbered and named capture groups for every match.

Replace preview

See the result of a replacement with group references.

Error messages

Invalid patterns show the exact error.

Frequently asked questions

Which regex flavor is used?

JavaScript (ECMAScript), the same as in browsers and Node.js. Most syntax is shared with PHP and Python.

Why do I only get one match?

Add the g flag to find all the matches.

How do I match a dot or a bracket?

Escape it with a backslash: \. or \[.

What are named groups?

Groups written as (?<name>…) that can be read by name instead of number.