test_regex
Validate regex patterns against sample text. Returns all matches, captured and named groups, and positions to confirm correctness before deployment.
Instructions
Test a regular expression pattern against text. Returns all matches, captured groups, named groups, and match positions. Useful for validating patterns before deploying them.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pattern": "<pattern>",
"text": "<text>"
},
"name": "test_regex"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to test the pattern against | |
| flags | No | Regex flags: i (case-insensitive), m (multiline), s (dotall), u (unicode) | |
| global | No | Find all matches, not just the first (default: true) | |
| pattern | Yes | Regex pattern without delimiters (e.g., "^[a-z]+$", "(\w+)@(\w+)\.(\w+)") |