Regex Extract
Paste your text, type a regular expression, and pull out every match. Toggle case-insensitive, multiline and dot-all modes, extract a specific capture group, or deduplicate the results. Runs in your browser; nothing is uploaded.
About this tool
Regex Extract runs a regular expression over a block of text and returns every match it finds, in order. It is the fast way to pull structured pieces — IDs, codes, emails, prices, tags — out of unstructured text without writing a script.
- Match flags: tick Ignore case for case-insensitive matching,
Multiline so
^and$anchor at the start and end of each line, and Dot matches newline so.also spans line breaks. - Capture groups: set Capture group to a number to return a specific
parenthesised sub-group instead of the whole match (
0= the whole match). For example, the pattern(\w+)=(\w+)with capture group2returns just the values. - Deduplicate: tick Unique matches only to collapse repeats, keeping first-seen order.
The syntax is the Rust regex flavour — a clean,
linear-time engine with no catastrophic backtracking.
Everything runs locally in your browser via WebAssembly — your text and your pattern are never uploaded.
Handy for
- Pulling every occurrence of a code, ticket ID, or token out of a log or document.
- Extracting one field from many lines via a capture group.
- Quickly testing what a regular expression actually matches against real input.
FAQ
Why don't lookaheads or backreferences work?
The engine is the Rust regex flavour, which guarantees linear-time matching —
that's why a hostile pattern can never hang the page. The trade-off is that
look-around ((?=…), (?<=…)) and backreferences (\1) aren't supported;
patterns using them are rejected with a syntax error. Usually a capture group
plus the Capture group option achieves the same extraction.
How do I extract just part of each match?
Wrap the part in parentheses and set Capture group to its number — 0 is the
whole match, 1 the first group, and so on. With (\w+)=(\w+) and group 2 you
get only the values. A group number larger than the pattern actually has produces
an error telling you how many groups exist; matches where an optional group
didn't participate are skipped.
Why does ^ only match at the very start of my text?
By default ^ and $ anchor the whole input. Tick Multiline to anchor at
the start and end of each line instead, and Dot matches newline if you want
. to span line breaks — the two flags are independent.
Does "Unique matches only" change the order of results?
No — deduplication keeps first-seen order, so the list still reflects where each distinct value first appeared in the text. Everything runs locally in your browser; neither the text nor the pattern is uploaded.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool regex-extract "Paste the text to search…" 'pattern=e.g. \b\w+@\w+\.\w+\b'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/regex-extract/?text=Paste%20the%20text%20to%20search%E2%80%A6&pattern=e.g.%20%5Cb%5Cw%2B%40%5Cw%2B%5C.%5Cw%2B%5Cb&ignore_case=true&multiline=true&dotall=true&capture_group=0&unique=trueMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
