Regex Extractor
Apply a regular expression to text and extract every match.
Developer Tools Runs in your browser
What is a regex extractor?
Write a pattern, paste a haystack, and every full match comes back one per line. The g flag is applied for you; add i, m, s, u or y as needed. A malformed pattern shows the engine’s error message instead of a blank screen. Matching happens in page-local JavaScript, worth knowing when the haystack is a production log.
How to use the Regex Extractor
- 1 Enter a pattern plus any flags beyond the built-in g.
- 2 Paste the text to search beneath it.
- 3 Full matches list one per line; a bad pattern shows the parser error instead.
- 4 Copy whichever matches you need.
What you can use it for
- Pulling all matches of a custom pattern from a log.
- Extracting IDs or codes that follow a known shape.
- Testing a pattern against sample data quickly.
- Harvesting structured fragments from messy text.
Frequently asked questions
Which flags does the extractor accept?
You can add i, m, s, u and y; g is always on because the point is scanning the whole input. Letters that are not valid flags are dropped without an error.
Can I extract just a capture group instead of the whole match?
Not here. Each output line is the complete match. The regex tester shows groups individually when you need to inspect $1 and $2 on their own.
What do I see if my pattern has a syntax error?
The JavaScript engine’s own message appears in place of results, so a missing bracket or an unterminated group is named and you can correct the expression.
Related tools
More Developer Tools
More tools like this:
All Developer Tools