Regex Match Extractor

Runs a JavaScript regular expression against text and lists every match found, one per line, using the standard RegExp/matchAll() engine. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

Pulling every email address, URL, or custom-pattern match out of a block of text is a common regex task.

This tool runs the match and lists the results directly.

What Is Regex Match Extractor?

A regex match extractor that runs your pattern against the input text with JavaScript's native RegExp engine and lists every full match, one per line.

It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.

How Regex Match Extractor Works

The tool constructs a RegExp from your pattern and flags (adding the global flag automatically if missing), then uses matchAll() to collect every match's full text.

The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.

When To Use Regex Match Extractor

Use it to pull all emails, URLs, or custom-pattern occurrences out of a block of text at once.

It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.

Often used alongside Regex Tester and Find & Replace Tool.

Features

Advantages

  • Uses the standard JavaScript regex engine, so patterns behave exactly as they would in code.
  • Always searches globally, collecting every match instead of just the first.

Limitations

  • Shows full matches only, not individual capture groups.

Examples

Extracting email addresses

Input

Contact: ada@example.com or alan@example.org for details.

Output

ada@example.com
alan@example.org

Both email addresses matching the pattern are listed, one per line.

Best Practices & Notes

Best Practices

  • Test tricky patterns with Test a String with Regex first if you're unsure whether they match as expected.

Developer Notes

The global flag is appended to whatever flags you supply if not already present (`flags.includes("g") ? flags : flags + "g"`), since String.prototype.matchAll() throws a TypeError if called with a non-global regex.

Regex Match Extractor Use Cases

  • Extracting all email addresses or URLs from a block of text
  • Pulling every occurrence of a custom pattern out of a log file
  • Testing a regex pattern's matches before using it in code

Common Mistakes

  • Expecting capture group values instead of full matches in the output.

Tips

  • Use Test a String with Regex first to confirm the pattern matches at all before extracting.

References

Frequently Asked Questions