Test Regex Pattern
regex_testExecute a regex against test strings and return the ACTUAL matches: match text, indices, capture groups, named groups, and optional replacement output. Deterministic proof, not prediction - run this before shipping a pattern. Patterns run sandboxed with a 250ms kill switch for catastrophic backtracking. JavaScript (ECMAScript) regex dialect.
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>",
"tests": "<tests>"
},
"name": "regex_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | Regex flags, e.g. "gi". Default "". | |
| tests | Yes | Strings to test the pattern against. | |
| pattern | Yes | The regex pattern (without slashes). | |
| replacement | No | If given, also return each input with the pattern replaced (supports $1, $<name>). |