Regex tester (JavaScript regular expressions)
regex_testerTests a JavaScript regular expression against text: whether it matches, each match with its index, numbered and named capture groups, and optionally a replace preview ($1, $ references). Supports flags d, g, i, m, s, u, v, y. Patterns prone to catastrophic backtracking, such as (a+)+, are refused; text up to 20,000 characters, up to 200 matches listed.
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 | Text to test (up to 20,000 characters). | |
| flags | No | Flags such as 'gi' (default 'g'). | |
| pattern | Yes | The regex source without slashes, e.g. '(\\d{4})-(\\d{2})'. | |
| replacement | No | Optional replacement string for a replace preview. |