regex-tester
Test a JavaScript regex against text. Returns all matches with their positions, captured groups, and named groups. Defaults to global flag so all occurrences are found.
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-tester"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to test against. | |
| flags | No | Regex flags. Allowed: g, i, m, s, u, y. Defaults to 'g'. | |
| pattern | Yes | The regex pattern, without delimiters. Standard JavaScript regex syntax. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | Yes | Flags used. | |
| matches | Yes | First 100 matches with positions and captured groups. | |
| pattern | Yes | Regex pattern, echoed back. | |
| truncated | Yes | True if more than 100 matches were truncated. | |
| match_count | Yes | Total number of matches found. |