Test a regular expression
regex_testRun a JavaScript regular expression against text and return all matches with index, capture groups and named groups, or the replaced text. Confirms a regex works before you rely on it.
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": "regex_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to search | |
| flags | No | Flags, e.g. gi | |
| pattern | Yes | JavaScript regex pattern (no slashes) | |
| replace | No | Optional replacement string ($1 etc.) |