Developer Utilities

Regex Matcher

All tools

Pull every match and capture group out of a block of text as a plain list.

How it works

Four simple steps

1

Set pattern and flags

Keep g in the flags box to collect every match.

2

Paste the text

Logs, documents or exports, as much as the page can hold.

3

Read the list

One match per line, with groups=[...] after each when present.

4

Copy the matches

Copy the list or download it as a text file.

Regex Matcher

About Regex Matcher

You have a page of copied log output and want every order ID that follows 'order #'. Highlighted matches are nice, but what you really need is the list itself. Regex Matcher prints each match on its own line, so the result drops straight into a spreadsheet or a script.

Type the pattern and the flags (g by default) into their fields and paste the text below. With g set, each match goes on its own line, followed by groups=[...] when the pattern has capture groups, so (\w+)@(\w+) shows both parts. The list stops at 500 matches. Without g, only the first match is returned, printed as the JSON array that exec() produces, which is useful for seeing every group including empty ones.

Avoid patterns that can match an empty string, such as \d* or a lone \b, while g is on. The matcher does not step past zero-length matches, so the same empty match repeats until the 500 limit. Use + instead of *, or anchor the pattern to something concrete. For a table with indexes, named groups and a ReDoS check, open the full regex tester; to change the matches rather than list them, use find and replace with regex. The contact list extractor is quicker if you only want emails or phone numbers.

Matching runs in this page with the browser's regex engine. Pasted text is not uploaded or stored.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

The pattern matched an empty string with g on, and the matcher does not advance past zero-length matches, so it repeats until it hits the 500-match cap. Change * to + or add something the pattern must consume.

Any combination JavaScript accepts, such as g, i, m, s, u and y. Invalid or repeated flags produce an error in the status line instead of results.

Rewrite the pattern so the whole match is the part you want, for example with a lookbehind such as (?<=order #)\d+. Each line then holds just the ID rather than the full match plus groups.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools