Regex Tester

Write or paste a regular expression and test it against sample text. Every match is highlighted live so you can fine-tune your pattern fast.

Pattern

Type a regex between the slashes. Flags (g, i, m, s, u, d) go in the small box. The default is g.

Result

Matches will appear here.

Private by design. The regex engine runs inside your browser. Nothing you type or paste leaves your device.

How the tester works

Building the expression

Type your pattern between the two slashes. The small box on the right is for flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode) and d (indices). The default is g for global matching.

Matching

As you type the pattern and the test string, each match is highlighted in blue. The summary below the result box shows how many matches were found. If the pattern is invalid (for example an unclosed bracket), the error is shown immediately so you can fix it.

Groups and captures

Capture groups (parenthesised parts of the pattern) are shown in the match detail below the highlighted text when there is more than one group. Each group is numbered starting at 1, matching the order your regex engine uses.

How to use the Regex Tester

  1. Type or paste your regular expression and the test text.
  2. Set the flags you need, such as global, case-insensitive and multiline.
  3. See every match highlighted, with capture groups listed.

Frequently asked questions

Which regex flavour is used?

The JavaScript regular expression engine, which is close to but not identical to PCRE.

Are lookbehinds supported?

Yes in modern browsers, along with lookaheads and named capture groups.

Why does my pattern match nothing?

Check the flags and escaping; the tool highlights matches live, so an empty highlight usually means the pattern or flags need adjusting.