Regex Match Extractor

Paste a document and a regular expression and get every match as a list. Choose the whole match or one capture group, or take all groups as columns for a CSV. Duplicates can be removed, and the result can be copied as lines, comma-separated text, CSV or a JSON array.

Tool

JavaScript syntax. You can also paste /pattern/flags.

3 matches

Matching runs in your browser. What you type never leaves this device.

Features

  • Every match of a JavaScript regular expression, in order

  • Pick the whole match, a numbered group, a named group, or all groups as columns

  • Output one per line, comma separated, as CSV or as a JSON array

  • Remove duplicate values, keeping the first occurrence

  • Match and unique counts, and download for CSV and JSON

  • Handles up to 50,000 matches

What people extract

Order and invoice numbers

Pull every #A1023-style order ID or GSTIN out of an email thread or export, ready to paste into a sheet.

Values from logs

Capture user IDs, status codes or response times from log lines with a group like status=(\d{3}) and count them.

Structured data from text

With two or more groups, such as (\w+)@([\w.]+), take all groups as CSV columns and open the result in a spreadsheet.

Getting the most from capture groups

Whole match or a group

Brackets in a pattern capture part of each match. In Order #(\w+) from (\S+@\S+), group 1 is the order number and group 2 the email. Pick a group in "What to extract" to keep just that part. Named groups such as (?<email>...) are listed by name.

Ready-made patterns

  • Email addresses: [\w.+-]+@[\w-]+\.[\w.]+
  • Indian mobile numbers: (?:\+91[\s-]?)?[6-9]\d{9}
  • URLs: https?://[^\s"'<>]+
  • Hashtags: #[\p{L}\d_]+ (tick Unicode)
  • Amounts in rupees: ₹\s?[\d,]+(?:\.\d{1,2})?

Just need emails or phone numbers?

The Extract Emails and Extract Phone Numbers tools do those two jobs without writing a pattern. To check a pattern step by step with highlighting, use the Regex Tester.

Regex Match Extractor - FAQ