How to extract regex capture groups
Sometimes you need only the dates, only the order numbers, or only the email domains out of a pile of log lines. The parts of a regular expression wrapped in parentheses are called capture groups, and this tool scans the whole text, finds every match, and lays the captured values out in a table. Feeding it (\d{4})-(\d{2})-(\d{2}), for example, puts the year, month and day into separate columns.
Named groups work too. Write (?<year>\d{4}) and the table header shows the name next to the group number. If the pattern is not valid, nothing is calculated and the browser's own error message is shown as is, so you can see exactly what went wrong. The table can be copied in one click as tab-separated text and pasted straight into a spreadsheet.
The processing limit is 20,000 characters. Some patterns make a regex engine take exponentially longer, so to keep the browser responsive only the first 20,000 characters are searched and the summary says when the input was cut. If there are very many matches, only the first 500 rows are listed and the summary says so. A pattern with no parentheses simply lists the full matches.
Frequently asked questions
Yes, named capture group syntax works as written and the table header shows the group number together with its name. If a name cannot be matched to a header column, groups are numbered only and the summary tells you.
The error is caught while the regular expression is being built, so nothing runs and the browser's syntax error message is shown exactly as reported. A separate message appears when the pattern is valid but nothing matches.