Regex Matcher
Test and match regular expressions against text.
Endpoint
POST https://www.acrewity.com/api/services/execute
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
n8n Integration
This service is also available via our n8n community node: @acrewity/n8n-nodes-acrewity
Operations
Match Pattern
Find all matches for a regular expression pattern in text.
Operation ID: match_pattern
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
pattern |
string | Yes | - | Regular expression pattern |
text |
string | Yes | - | Text to search in |
flags |
string | No | g |
Regex flags (g, i, m, etc.) |
Example Request
Extract Email Addresses:
{
"service": "regex-matcher",
"operation": "match_pattern",
"parameters": {
"text": "Contact sales@example.com for pricing or support@example.com for help. Our CEO is john.doe@company.org",
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"flags": "g"
}
}
Extract Phone Numbers:
{
"service": "regex-matcher",
"operation": "match_pattern",
"parameters": {
"text": "Call us at (555) 123-4567 or 555.987.6543. International: +1-800-555-0199",
"pattern": "\\+?\\d?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}",
"flags": "g"
}
}
Case-Insensitive Search:
{
"service": "regex-matcher",
"operation": "match_pattern",
"parameters": {
"text": "The quick Brown FOX jumps over the lazy dog",
"pattern": "fox",
"flags": "gi"
}
}
Example Response
{
"success": true,
"result": {
"data": {
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"flags": "g",
"text_length": 101,
"matches": [
{ "match": "sales@example.com", "index": 8, "groups": null },
{ "match": "support@example.com", "index": 41, "groups": null },
{ "match": "john.doe@company.org", "index": 81, "groups": null }
],
"match_count": 3
}
},
"credits_used": 1
}
More Examples
See Utilities & Helpers Examples for complete workflow examples including data extraction, log parsing, and text validation.