analyze
Test a regex pattern for correctness, ReDoS safety, and memory efficiency, and get actionable rewrite suggestions when it fails.
Instructions
Composite verdict: accept pattern only if it (a) passes all test cases, (b) shows no super-linear NFA growth on the engine, and (c) compiles within the RE2 memory bound. On rejection, names the dangerous construct and the family of safe rewrites to try. Does not auto-rewrite.
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": "analyze"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engine | No | python | |
| qlimit | No | ||
| pattern | Yes | ||
| negatives | No | ||
| positives | No | ||
| timeout_ms | No | ||
| mem_bound_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||