regex_extract
Apply a regular expression to text and return every match with index, numbered and named capture groups, plus a ReDoS risk assessment. Execution is budget-capped to prevent hangs.
Instructions
Apply a regular expression and return every match with its index, numbered capture groups and named groups. Iteration and match counts are hard-capped so a pathological pattern cannot hang the host. The response includes a ReDoS risk assessment of the pattern.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to search | |
| flags | No | Flags from g i m s u y (g is always applied) | |
| pattern | Yes | Regular expression source, without slashes | |
| budgetMs | No | Execution deadline in milliseconds (default 1000, max 10000). Execution runs in a worker thread that is terminated on expiry. | |
| maxMatches | No | Cap on returned matches (default 500) |