Regex Tester

Test a regular expression against sample text and inspect what the pattern matches.

Input

Pattern and test text

Enter a JavaScript pattern without surrounding slashes. The test runs in a separate worker and stops if it takes too long.

JavaScript flags
g: all matches, i: ignore case, m: line anchors, s: dot includes line breaks, u or v: Unicode, y: sticky, d: capture positions.

Result

Highlighted matches and captured groups.

Enter a pattern and select Test regular expression.

Runs in your browser. Nothing is uploaded.

Also known as: regular expression tester, regex matcher, test regex pattern

How to use

  1. Enter a JavaScript regular expression without the surrounding slashes.
  2. Set flags and paste your test text.
  3. Run the test and open a match to inspect its groups or offsets.

Frequently asked questions

Which regex syntax is used?

The JavaScript RegExp engine in your browser. Syntax from Python or PCRE may not work.

How do I find more than the first match?

Enable the g flag. Without it the tool reports only the first match.

What happens if a pattern takes too long?

The dedicated worker is stopped so the page stays usable. Reduce the text or simplify the pattern before retrying.

How are offsets counted?

They are zero-based UTF-16 indices, just like JavaScript string offsets. The d flag shows offsets for captured groups.