Regex Tester

Test any regular expression against a string and see all matches highlighted in real time, with capture groups listed separately.

How to use

  1. Enter your regular expression pattern (without the slashes) and any flags (g, i, m, s).
  2. Paste the test string in the text area below.
  3. Click Test to see all matches highlighted and capture groups listed.

Frequently asked questions

What flags are supported?

All standard JavaScript regex flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — . matches newlines), u (Unicode) and d (indices).

Why does my regex not match?

Common issues: forgetting the g flag (only finds the first match without it), escaping issues (use \ for literal backslash), or anchors (^ and $ match the whole string by default, not each line — add the m flag for multiline).

What are capture groups?

Capture groups are parts of the pattern wrapped in parentheses (). They capture the matched text for that part of the pattern. Named groups use (?<name>...) syntax. The tool lists all captured groups for each match.

Is this JavaScript regex syntax?

Yes — the tool uses the browser's built-in RegExp engine, which follows the ECMAScript standard. Most patterns are compatible with other languages, but some features (like lookbehind) may differ.

Related tools