Skip to content
OddsockLocal
Local
Source text

Formatting

4 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text.
  2. Set Pattern and Flags. g is added if you leave it out.
  3. Set Capture group. 0 is the whole match. 1 is the first pair of parentheses.
  4. Copy the lines. One line per match.

What is Regex match extractor?

The extractor applies a pattern and prints matches as lines, nothing else. Pattern v(\d+) with the global flag, capture group 1, against v2 v12 returns 2 and then 12. Group 0 would have been the whole match, v2 and v12. The group field is the difference from the tester, which shows indexes and named groups as JSON and can also replace.

Read more

Flags default to gu: global and unicode. If you omit g, the page adds it, because a non-global extract would stop after the first hit and look like the text only contained one number. Group numbers start at 0 for the full match. A group that did not participate is an empty line, not a skipped row, so the list stays aligned with the hits.

An invalid pattern fails. The escape page is how you make a literal safe before you put it in the pattern box. The splitter is the opposite job: it throws the matches away and keeps the pieces between them.

Use cases

  • A log line has v2 and v12 and you want the numbers only, from capture group 1.
  • You need a plain list to paste into a spreadsheet, not a JSON report of indexes.
  • A global flag was forgotten in another tool and only the first version number came back. Here g is added.
  • You want empty captures to stay as blank lines so the third match is still the third line.

The digits inside each v-number

Text v2 v12. Pattern v(\d+). Flags g. Capture group 1.

2\n12

Why use Oddsock

Group 1 is a different result from the full match. The tester will show both; this page prints only the group you numbered.

Related tools

Using this tool

Capture group was 1, and the parentheses are around the digits. Group 0 would include the v.