# Multi-Pattern Matcher

Match multiple regex patterns against text in one operation

> Canonical page: https://elysiatools.com/en/tools/multi-pattern-matcher

- **Category:** Development

- **Keywords:** regex, pattern, matcher, multiple, batch, extract, search, regex patterns

## Overview

**Pattern Format (one per line):**

```
Label|Pattern|Flags
```

**Examples:**

- `Email|\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b|gi`
- `Phone|\b\d{3}-\d{3}-\d{4}\b|g`
- `URL|https?://[^\s]+|gi`

**Flags (optional):**
- `g` - Global (find all matches)
- `i` - Case insensitive
- `m` - Multiline
- `s` - Dot matches newline
- `u` - Unicode

**Notes:**
- Flags are optional (defaults to 'g')
- Patterns with named groups will extract those values
- Results are sorted by match count (descending)

## Inputs

- **Text Input** (textarea): Enter text to search...
- **Patterns** (textarea): One pattern per line: Label|Pattern|Flags (flags optional)
- **Case Sensitive** (checkbox)
- **Show Empty Patterns** (checkbox)
- **Max Matches Per Pattern** (number)

## When to use

- When extracting multiple data types like emails, phone numbers, or URLs from large text documents.
- For analyzing logs or reports to find specific patterns across different categories simultaneously.
- When validating text input against several regex rules in a single run to save time and reduce errors.

## How it works

- Enter or paste the text to search in the Text Input field.
- Define patterns in the Patterns field, one per line, using the format: Label|Pattern|Flags.
- Adjust optional settings such as case sensitivity, showing empty patterns, or limiting matches per pattern.
- Run the tool to receive a JSON result with matches grouped by pattern label and sorted by frequency.

## Use cases

- Extracting contact information like emails and phone numbers from customer feedback or survey responses.
- Scanning server logs for error codes, IP addresses, and timestamps in a single operation for efficient monitoring.
- Validating user-submitted text against multiple content policies, such as checking for profanity, links, or specific formats.

## Frequently asked questions

### What is the pattern format for defining rules?

Each pattern should be on a new line in the format: Label|Pattern|Flags. Flags are optional and include g (global), i (case insensitive), m (multiline), s (dot matches newline), and u (Unicode).

### Can I use named groups in my regex patterns?

Yes, patterns with named groups will extract those values in the results, making it easier to identify specific data.

### What happens if a pattern has no matches in the text?

By default, patterns with no matches are not shown in the results. You can enable 'Show Empty Patterns' to include them for completeness.

### Is there a limit to how many matches are returned per pattern?

You can set a maximum number of matches per pattern using the 'Max Matches Per Pattern' option, which defaults to 50 to prevent overwhelming output.

### How are the results organized in the output?

Results are returned as JSON, sorted by match count in descending order, so patterns with the most matches appear first for quick analysis.

## Related tools

- [Java Regex Tester](https://elysiatools.com/en/tools/java-regex-tester): Test java.util.regex patterns online: (?…) named groups, possessive quantifiers and atomic groups, Pattern flags, ASCII vs UNICODE\_CHARACTER\_CLASS \\d semantics, and ready-to-paste Java code.
- [AI Regex Explainer](https://elysiatools.com/en/tools/ai-regex-explainer): Use AI to break down regular expressions into readable explanations
- [Filter Text Paragraphs](https://elysiatools.com/en/tools/text-paragraph-filter): Quickly return all paragraphs that match a pattern or a regex
- [Filter Text Sentences](https://elysiatools.com/en/tools/text-sentence-filter): Quickly return all sentences that match a pattern or a regex
- [Filter Words in Text](https://elysiatools.com/en/tools/text-word-filter): Quickly return words in text that match a pattern or a regex
- [Bulk Email Extractor](https://elysiatools.com/en/tools/bulk-email-extractor): Extract all email addresses from input text, articles, web source code, or mixed content. Supports deduplication and export to JSON.
- [C# Regex Tester (.NET)](https://elysiatools.com/en/tools/csharp-regex-tester): Test .NET/C# regular expressions online with named groups ((?…)), IgnoreCase/Multiline/Singleline options, match highlighting, capture-group tables, a ready-to-paste C# snippet and an IgnorePatternWhitespace preview.
- [Python Regex Tester (re module)](https://elysiatools.com/en/tools/python-regex-tester): Test Python re patterns online: (?P…) named groups, (?P=name) backreferences, VERBOSE patterns, findall behavior, and \\g replace templates — plus ready-to-paste Python code.

## Samples

- [Regex Pattern Alternatives](https://elysiatools.com/en/samples/regex-alternatives): Multiple ways to write the same regex pattern with different trade-offs in readability, performance, and accuracy
- [Regex Replace Samples](https://elysiatools.com/en/samples/regex-replace): Collection of common and useful regex replacement patterns for text transformation and data cleaning
- [Glob Pattern Samples](https://elysiatools.com/en/samples/glob-samples): Glob pattern examples for file matching from basic to complex patterns
- [Regex Named Capture Groups](https://elysiatools.com/en/samples/regex-named-groups): Collection of regex patterns using named capture groups for extracting structured data from text. Named groups make patterns more readable and maintainable by assigning meaningful names to captured portions.

## Related content

- [Regex Testing, Visualization, and Safety Workflow](https://elysiatools.com/en/hubs/regex-utility): Build reliable regular expressions by learning syntax, testing matches, visualizing structure, previewing replacements, benchmarking alternatives, and scanning for ReDoS risk.
- [Observability Debugging from Logs, Traces, Webhooks, and JSON Payloads](https://elysiatools.com/en/hubs/observability-debugging): Parse logs, decode traces, inspect webhook/API evidence, explore JSON payloads, and extract recurring patterns before writing an incident-ready debugging note.
- [PII Detection and Log Redaction Review](https://elysiatools.com/en/hubs/pii-log-redaction): Find likely personal data in logs, text, and PDFs, redact review copies, validate identifier patterns, and require human approval before sharing.
