Regex Tester

Test regular expressions with live match highlighting, groups and replace — safely, with a timeout.

Runs instantly in your browser — results update as you type.

What is a regex tester?

A regex tester lets you write a regular expression and immediately see which parts of a sample text it matches, including capture groups, so you can build and debug patterns before using them in code.

Features

  • Live highlighting of every match as you type.
  • A table of matches with their position and capture groups.
  • Replace preview using $1, $2 or named groups $<name>.
  • Flags: g (global), i (ignore case), m (multiline), s (dot matches newline), u (unicode).
  • A 2-second safety timeout: patterns with catastrophic backtracking are stopped instead of freezing your browser.

Quick reference

TokenMatches
\d / \w / \sdigit / word character / whitespace
.any character except newline
* + ? {2,5}0+, 1+, 0–1, 2–5 times
^ / $start / end of line (with m) or text
(…) / (?:…)capture group / non-capturing group

The tester uses the JavaScript regex engine, which matches the behaviour of Node.js and browsers; most patterns also work in PHP (PCRE) and Python.

Frequently asked questions

Which regex flavour is used?

JavaScript (ECMAScript). Syntax is very close to PCRE, but lookbehind support and some flags differ in other languages.

Why was my regex stopped?

It ran for more than 2 seconds, usually because of nested quantifiers like (a+)+ that cause catastrophic backtracking.

Do I include the slashes?

No. Enter only the pattern and choose flags with the checkboxes.