Key Facts
- Category
- Development
- Input Types
- textarea, checkbox, number
- Output Type
- json
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The Multi-Pattern Matcher enables you to define and execute multiple regular expression patterns against a single text input in one operation. It supports labeled patterns with optional flags, streamlining batch text processing and data extraction tasks.
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
Examples
1. Extracting Contact Details from Text
Data Analyst- Background
- You have a large text file containing customer inquiries and need to pull out all email addresses and phone numbers for follow-up.
- Problem
- Manually searching for each type of contact information is time-consuming and prone to missing entries.
- How to Use
- Paste the text into the Text Input field. In Patterns, enter: Email|\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b|gi and Phone|\b\d{3}-\d{3}-\d{4}\b|g
- Outcome
- The tool returns a JSON object with all found emails and phone numbers, labeled and sorted by frequency, enabling quick export or analysis.
2. Log File Analysis for Security Monitoring
Security Engineer- Background
- You need to monitor web server logs for suspicious activities, including failed login attempts and access from blacklisted IPs.
- Problem
- Logs are extensive, and manually checking for multiple patterns across different categories is inefficient and delays incident response.
- How to Use
- Paste the log text into the Text Input field. Define patterns such as FailedLogin|Failed password for .* from \d+\.\d+\.\d+\.\d+|gi and IP|\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b|g in the Patterns field.
- Outcome
- A structured JSON list of all matches is generated, helping to quickly identify and investigate security incidents by pattern label.
Try with Samples
text, regexRelated Hubs
FAQ
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.