Regex Extract

Extract every match or a specific capture group from text, one per line, ready to copy or download.

Options

Input

Ctrl + Enter to run

Result

Extract every match of a regular expression, or just one capture group, one per line. Handy for pulling emails, IDs, URLs or numbers out of a log or document.

Pick the group by number or name and optionally remove duplicates while keeping the original order.

How to use it

  1. Type the pattern and flags.
  2. Paste the text.
  3. Enter the group (0 for the whole match) and press Run.

Example

Example input
[\w.+-]+@([\w-]+\.[\w.-]+)

Contactos: ana@example.com, luis@example.org; soporte@example.com
Result
example.com
example.org

Limitations

  • Groups that do not take part in a match are skipped.
  • Same limits as the tester: 1 s, 10,000 matches, 256 KiB of text.

FAQ

Can I extract just the domains from emails?
Yes: put a group around the domain part and enter that group number in the option.
Is order kept when removing duplicates?
Yes, the first occurrence of each value is kept.

Related tools

References