Test a JavaScript regular expression
test_regexRun a JavaScript regular expression against a sample and return every match, capture group, a short explanation, and an optional replacement.
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 | Sample to search. | |
| flags | No | ||
| pattern | Yes | JavaScript regular expression body, without slashes. | |
| replacement | No | When set, the sample is replaced and returned. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matches | Yes | ||
| truncated | Yes | ||
| explanation | Yes | ||
| replacement | Yes |