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.