Skip to main content

Regex Extractor — Extract Text with Regex Online

Pull emails, URLs, phone numbers, dates, and any custom pattern out of text with a regular expression. Get every match in a table with capture-group columns, dedupe, count, and export to CSV, JSON, or plain lines — 100% in your browser, nothing uploaded.

//

Related regex tools

Frequently asked questions

How do I extract all matches from text with a regex?
Type your pattern in the pattern box, choose flags, and paste the source text. The extractor runs the pattern globally and lists every match in a table with its match number, matched text, character index, and capture-group columns. Example: the pattern \d+ against Order 42 shipped extracts 42 at index 6. You can then dedupe, count, or export the list.
How do I extract email addresses from text?
Click the Email preset, which loads [\w.+-]+@[\w-]+\.[\w.]+. Against Contact alice@example.com or bob@test.org, and alice@example.com again. it extracts 3 matches at indexes 8, 29 and 47; the dedupe toggle reduces that to 2 unique addresses. Use Copy or Export to get the clean list.
Can I extract capture groups into separate columns?
Yes. Parentheses become columns in the results table, and named groups get their own labeled columns. The pattern (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) against Launch 2026-10-09 and 2025-01-01 produces columns year=2026, month=10, day=09 for the first match. CSV export keeps those columns too.
What export formats are supported?
Three: plain line-separated (one match per line), CSV (match, index, and one column per capture group, with proper quoting), and JSON (an array of {match, index, groups, named} objects). All three are also downloadable as .txt, .csv, and .json files.
What does the dedupe toggle do?
It keeps only the first occurrence of each distinct match value. With #[A-Za-z0-9_]+ against #ai #AI #ai #seo, dedupe leaves 3 values: #ai, #AI, and #seo. Enable case-insensitive dedupe and #ai and #AI collapse to one, giving 2. The frequency view also shows how many times each value appeared.
Which flags are supported?
g (global — always on for extraction, since the tool lists all matches), i (case-insensitive), m (multiline, so ^/$ work per line), and s (dot-all, so . also matches line breaks). Clicking a flag button explains what it does.
Why do I get “Invalid regular expression”?
The pattern has a syntax error and the tool shows JavaScript's exact message. For example, the pattern ( reports Invalid regular expression: /(/g: Unterminated group. Common causes are unclosed brackets or parentheses, a stray quantifier like *abc, or an unescaped special character.
Is my text uploaded anywhere?
No. The extractor runs entirely in your browser with JavaScript — the pattern, the source text, and the results never leave your device. There are zero external requests, no accounts, and nothing to install.
What is the difference between this and the Regex Tester?
The Regex Tester is for authoring and debugging a pattern: live highlighting, a plain-English pattern explainer, find & replace, and catastrophic-backtracking warnings. This Regex Extractor is for pulling data out of text at scale: dedupe, match counts, a frequency view, and CSV/JSON export of matches and capture groups. If your pattern misbehaves, debug it in the Regex Tester first, then extract here.
Can I extract URLs or phone numbers too?
Yes, use the built-in presets. The URL preset https?://(?:www\.)?[A-Za-z0-9.-]+\.[A-Za-z]{2,}(?:/[^\s<>"']*)? against See https://example.com/a and http://x.org, ok extracts exactly https://example.com/a and http://x.org without the trailing comma. The phone preset extracts +1 (555) 123-4567 and 021-555-8899 from a contact block. For URL-only scraping with href parsing, the dedicated Regex URL Extractor goes further.
Privacy: extraction runs entirely in your browser with JavaScript. Your pattern and text never leave your device — there are no servers, accounts, or uploads.

Free tool by NRTechStudio