Skip to content
.*

Regex Tester

Test a regular expression and see every match with its groups.

Runs in your browser

Updated

Regular expressions can backtrack catastrophically. This page caps the input at 20,000 characters, but a pathological pattern can still lock the tab. If that happens, reload without your pattern.
/ /

Matches

Matches

0

Capture groups

0

Test string length

0

Coverage

0%

Match details

#MatchIndexGroups

Common patterns

Flags: g find every match, i ignore case, m multiline anchors, s dot matches newlines, u Unicode mode. Without g only the first match is reported, which is the correct behaviour for a single search.

Test a pattern against real text

Enter a pattern, paste the text to test, and the tool highlights matches, counts capture groups and lists each match with its index and groups. Coverage reports what percentage of the input the matches span.

Flags

Chips are provided for g, i, m, s and u. None is enabled by default, so tick "g" when you want every match rather than the first. "i" ignores case, "m" makes ^ and $ match line boundaries, "s" lets a dot match newlines, and "u" switches to Unicode code-point mode.

Limits

  • The test string is truncated at 20,000 characters and matching stops after 2,000 results.
  • JavaScript dialect only. Lookbehind and named groups work in modern browsers, but PCRE or Python-specific syntax may not.
  • Indices are UTF-16 offsets, so an emoji can shift them by two.
  • There is no timeout. A catastrophically backtracking pattern can freeze the tab, so anchor or simplify it.

A worked example

Given the text "ping admin@example.com now" and the default pattern, the address is reported as match 1 at index 5, with three capture groups: admin, example and com. Ticking g finds every remaining address in a longer text and updates the coverage figure.

What it does not do

No find-and-replace, no saved patterns and no file input. To escape literal characters before building a pattern, the text escape tool helps; to validate JSON you extracted with a pattern, use the JSON validator.

Questions people ask

Why does my pattern match only once?

The global flag is off by default. Tick g.

Are capture groups shown?

Yes, numbered from $1 upward in the results table.