Text & String Utilities100% Client-Side

Extract Regular Expression Matches

Paste text and enter a regular expression to extract the matching fragments. The tool searches the full input and reports matches in the order it finds them. If the pattern includes capture groups, the output shows the captured values for each match. This is useful when the rest of each line is context and you only need the specific fields identified by the pattern.

Configuration Options
Input
31 chars•1 lines
Output

How to Use the Extract Regex Matches from Text Online

  1. 1Paste the source text with its original spacing and line breaks.
  2. 2Enter the pattern and put flags in the separate field.
  3. 3Add capture groups only around the values you want to see in the result.
  4. 4Review the rows, or remove the capture groups when you need the entire matching fragment.

Input & Output Examples

The pattern captures only the letter and digits after Item. The label is part of the match but stays outside the capture.

Input Sample
Item A12, Item B08
Expected Output
A12
B08

Two capture groups put the direction and number on the same row separated by a vertical bar. The tool finds both matches even with the flags field empty.

Input Sample
west=12; east=7
Expected Output
west | 12
east | 7

Practical Developer Workflows

  • Extract short record labels from a formatted paragraph.
  • Pull two related values from each repeated entry and inspect them together.
  • Compare a case-sensitive pattern with a case-insensitive one against the same fixture.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

It shows matched fragments or captured values. A match in the middle of a line can return just that portion. Use Grep Lines to keep complete lines based on a pattern instead.

Explore Other Tools

12 suggested tools

View all tools