Skip to content

Regex Match Extractor

Pull every match out of text, with capture groups, named groups and positions.

Runs in your browserNo account neededFree
Loading tool…

Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.

How to use the regex match extractor

  1. Write your pattern with the g flag on.
  2. Paste your text.
  3. Read the matches, groups and positions, then copy them.

About this tool

Every match is listed with its position, its numbered capture groups and any named ones, which is the difference between this and a plain find. When a pattern is not doing what you expect, seeing which group captured what usually shows why immediately.

A group that did not participate in a match is shown as such rather than as an empty string. Those are genuinely different — an optional group that never matched gives <code>undefined</code>, not <code>""</code> — and code that treats them the same tends to break on the edge case.

Output is capped at 2,000 matches to keep the page responsive. Patterns that can match an empty string are advanced by one character each time, which is what stops them looping for ever.

Patterns run in a background worker and are stopped after two seconds. That matters more than it sounds: a pattern that backtracks catastrophically would otherwise freeze the tab completely, leaving you unable even to edit the pattern that caused it. Here it reports a timeout and the page keeps working.

Common uses

  • Pulling every URL, email or id out of a block of text.
  • Checking which capture group is picking up what.
  • Extracting fields from log lines.

Frequently asked questions

Why is only one match shown?
The g flag is off. Without it a regex returns the first match only.
What does 'did not participate' mean?
That group was optional and did not match anything. It is different from matching an empty string, and code that conflates the two often breaks.
Is there a limit?
Output is capped at 2,000 matches so the page stays responsive. The cap is stated when it applies.

Related tools