Regex Match Extractor

Write a regular expression and paste your text. Every match, or the capture group you choose, comes out as a list with one value per line, ready to copy or download.

How it works

Your pattern runs in your browser's own JavaScript regex engine, with the g flag always on, so every match in the text is found, not only the first.

If the pattern has groups in brackets, the Keep menu lists them, named groups included. Choose one and only that part of each match is kept. A group that took no part in a match adds no line.

The run happens in a background worker. If a pattern takes more than one second, the worker is stopped, so a pattern that backtracks badly cannot freeze the page. Nothing you type leaves this page.

How to use it

  1. 1 Type a pattern in the Pattern box, without the slashes.
  2. 2 Turn on any flags you need, such as Ignore case.
  3. 3 Paste your text. The list updates as you type.
  4. 4 To keep only part of each match, put brackets around it and choose that group under Keep.
  5. 5 Use Trim spaces, Drop empty lines and Each value once to tidy the list, then copy it or download it as a .txt file.

Good to know

  • Each value once is handy for collecting the distinct email addresses, IDs or hostnames in a log.
  • A named group such as (?<id>\d+) shows up under Keep by name, which is easier to read than Group 3.
  • Turn on "^ and $ match at each line" to anchor a pattern to the start or end of each line, not the whole text.
  • To test a pattern and see where each match sits in the text, use the Regex Tester. This tool is for getting the list out.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

From a wall of text to a clean list

Much of the data people need sits inside text that was never meant to be data: a log file, an exported chat, a page of search results, a long email thread. You want the order numbers, or the email addresses, or every price, and you want them as a plain list you can paste into a spreadsheet. A regular expression describes what each value looks like. This tool runs it over the text and gives you every match, one per line.

Take the example on the page. Four lines of a shop log each mention an order: "order #1042 paid by ana@example.com" and so on. The pattern order #(\d+) matches the words "order #" followed by one or more digits. With Keep set to Whole match, the list holds "order #1042", "order #1043" and the rest. Set Keep to Group 1 and the list holds only 1042, 1043, 1044 and 1045, because the brackets marked the digits as the part to keep. Groups can also have names. Write (?<id>\d+) and the Keep menu offers "Group <id>".

Three switches tidy the list after the run. Trim spaces removes spaces at the start and end of each value, which helps when a pattern catches the space before a word. Drop empty lines removes blank values. Each value once keeps the first of each repeated value and drops the rest, so a log with the same customer address on forty lines gives you that address once. Repeats are compared exactly, so Ana@example.com and ana@example.com count as two values. The summary under the result says how many values there were before and after tidying.

Regular expressions have one known trap: some patterns take exponential time on text they almost match. A pattern such as (\w+\s?)+$ can run for minutes on a long line that ends in a symbol, as the engine tries every way to split the words. In many tools that freezes the browser tab. Here every run happens in a background worker with a one-second limit. If the limit is reached, the worker is stopped, the page stays responsive, and you get a message explaining the likely cause.

The tool uses your browser's JavaScript regex engine, so the syntax is JavaScript's. Flags are offered for ignoring case, for making ^ and $ match at each line, for letting the dot match line breaks, and for full Unicode. The global flag is always on, because the point is to get every match. Your text never leaves the page, so you can use it on logs and exports that hold customer data. For checking where a pattern matches, or for replacing matches, the Regex Tester is the better tool.

Frequently asked questions

How do I extract only part of each match?

Put brackets around the part you want. For order #(\d+), the brackets hold the number. Then choose Group 1 under Keep. Every line of the result is just the number, without "order #".

Why was my pattern stopped?

It ran for more than one second. That usually means a quantifier inside another quantifier, such as (a+)+ or (\w*)*, failing near the end of a long line, which makes the engine try a huge number of ways to match. Make the inner part match one way only, or anchor the pattern.

Which regex syntax does this use?

JavaScript's, as built into your browser. It supports lookahead and lookbehind, named groups and Unicode property escapes such as \p{L} with the Unicode flag on. It does not support possessive quantifiers or inline flags such as (?i).

Is my text sent to a server?

No. The pattern and the text stay in this page and are run in a worker in your browser.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.