Regex tester
regex_testTest JavaScript regular expressions against a subject string and retrieve detailed match information including indices, capture groups, and named groups. Supports all standard regex flags.
Instructions
Run a JavaScript regular expression against a subject string and return each match with its index, positional capture groups, and any named groups. Flags are honored exactly: without the g flag only the first match is returned; with g, all matches.
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>",
"subject": "<subject>"
},
"name": "regex_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | Regex flags, e.g. "g", "i", "m", "s" | |
| pattern | Yes | The regular-expression source (no slashes) | |
| subject | Yes | The text to search |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| valid | Yes | ||
| matches | No | ||
| matchCount | No |