Regex Match Extractor
Pull every match out of text, with capture groups, named groups and positions.
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
- Write your pattern with the g flag on.
- Paste your text.
- 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
Regex Tester
Test a regular expression against sample text with live highlighting and capture groups.
Regex Replace Tester
Test a regular expression replacement with capture groups and see the result live.
Regex Split Tester
Split text on a regular expression and see each resulting part, empties included.
Extract Emails, URLs & More
Pull email addresses, links, numbers, hashtags, mentions, IPs or dates out of any text.