Collection-first output
Receive a JSON list of matching values rather than an altered copy of the source.
Start typing to search 227 tools.
Extract all regex matches and capture groups from text.
Regex Extractor collects data from text instead of rewriting it. The tool finds every PCRE match and returns either the complete match or one numbered capture group as a structured JSON list.
Choose group 0 when the exact text matched by the pattern is the desired value. Choose group 1 or later when the expression needs surrounding context but only one captured field should be returned. Every output row includes an occurrence number and the byte offset of that selected value in the original source.
The Unique values option removes repeated values from the final list. This page is designed for collection and export; use Regex Tester PRO for detailed group diagnostics and Regex Replace when the source itself must be transformed.
Focused controls, predictable output, and a workflow designed around this exact transformation.
Receive a JSON list of matching values rather than an altered copy of the source.
Return a complete match or isolate one numbered capture group from surrounding context.
Use match numbers and source offsets to locate each extracted value in the original input.
Preserve repeated occurrences or collapse them to the first unique value.
Practical details about input, output, privacy, limits, and the best way to use this tool.
It returns JSON containing the selected group number, extraction count, and a list of values with occurrence numbers and source offsets.
Group 0 is the complete regex match. Groups 1–99 refer to numbered parenthesized captures inside the pattern.
Select group 1 when surrounding labels or delimiters help find a record but only the captured field should appear in the output.
It removes later duplicate values while preserving the first occurrence and its source offset.
The extractor currently reports byte offsets. UTF-8 characters can occupy more than one byte, so use Regex Tester PRO when Unicode character, line, and column positions are needed.
The extraction selector accepts numbered groups. Use Regex Tester PRO when you need a detailed named-group report.
No. Validate calendar dates, addresses, identifiers, and other business data after extraction.
Yes. Avoid ambiguous alternatives and nested quantifiers, limit source size, and test long nonmatching input.
Understand regex syntax, character classes, groups, quantifiers, flags, practical examples, and common mistakes.
The label helps locate each record while group 1 returns only the identifier.
Text:
order=API-2048 status=paid
order=WEB-7315 status=pending
Pattern: \border=([A-Z]{2,5}-\d{3,8})\b
Group: 1
API-2048 WEB-7315
Duplicate captured values collapse to their first occurrence.
Text:
version=2.4.1
Version: v2.4.1
version=3.0
Pattern: \bversion[=: ]+v?(\d+(?:\.\d+){1,3})\b
Group: 1
Unique: yes
2.4.1 3.0
Group 0 returns every complete match.
Text: Start 2026-09-04, finish 2026-09-18
Pattern: \b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b
Group: 0
2026-09-04 2026-09-18
Regex Extractor scans the source for repeated records and emits only the chosen values. It does not include the complete diagnostic tree produced by Regex Tester and it does not create transformed prose like Regex Replace. The result is intentionally compact: selected group, count, match number, value, and source offset.
This workflow fits log identifiers, version numbers, dates, URLs, email-like strings, reference codes, and labels in semi-structured exports. Regex works best when every desired token has a repeatable boundary.
Pattern: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b
Flags: iu
Group: 0
Pattern: \border=([A-Z]{2,5}-\d{3,8})\b
Input: order=API-2048 status=paid
Group: 1
Output value: API-2048
Pattern: \bversion[=: ]+v?(\d+(?:\.\d+){1,3})\b
Flags: iu
Group: 1
Unique values: enabled
Pattern: \b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b
Group: 0
Pattern: \bid=["']([^"']+)["']
Group: 1
Use group 0 when boundaries are excluded from the pattern and the full match is already clean. Use a numbered group when a stable label such as order= is needed to locate the value but should not be exported. Non-capturing parentheses (?:...) organize a pattern without increasing the group number.
If the selected group does not exist, the tool stops with a clear error. If an optional group does not participate in a particular match, that row is skipped. Test every alternative branch so the chosen group remains present and meaningful.
Keep duplicates when each occurrence matters, such as repeated events in a log. Enable unique values for a compact set of domains, identifiers, or versions. Deduplication preserves the first occurrence, so its offset still points to a real location in the source.
Offsets are measured in UTF-8 bytes. For human-facing Unicode character offsets, line numbers, and columns, open the same expression in Regex Tester PRO. A byte offset is still useful for server-side processing and tracing values back into the exact source payload.
A regular expression can confirm shape without confirming meaning. An ISO-shaped date can still name a nonexistent calendar day, an IPv4-shaped candidate can contain an invalid octet if the pattern is broad, and an email-like value can reference no working mailbox. Apply domain validation before database import or automation.
Compare the returned count with an expected range. An unexpectedly large count often means a permissive boundary or an empty-string-capable expression. Review the PHP preg_match_all reference and PCRE2 documentation for engine behavior.
Inspect every group and position with Regex Tester PRO, generate a starting expression with Regex Builder, or modify matching source text with Regex Replace.