regex_analyze
Statically analyze a regex for ReDoS risks without executing it. Returns risk level and reasons such as nested quantifiers, overlapping alternation, or backreferences.
Instructions
Statically analyse a regular expression for catastrophic backtracking (ReDoS): nested quantifiers, overlapping alternation inside repeated groups, backreferences under quantifiers, excessive wildcards. Returns a risk level and the specific reasons. The pattern is not executed.
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>"
},
"name": "regex_analyze"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Regular expression source to analyse |