regex
Test a JavaScript regex against text or files to get matches with line/column, groups, and replace previews. Returns full, partial, or no-match cases and times out runaway backtracking.
Instructions
Test a JS regex (/x/flags ok): matches with line/col and groups, replace preview, cases (full/partial/none). Timeout catches catastrophic backtracking.
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>"
},
"name": "regex"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | or a file | |
| text | No | ||
| cases | No | ||
| flags | No | ||
| pattern | Yes | ||
| replace | No | ||
| timeout_ms | No | ||
| max_matches | No |