Test Regex Pattern
regex_testExecute a regex against test strings and return the ACTUAL matches: match text, indices, capture groups, named groups, and optional replacement output. Deterministic proof, not prediction - run this before shipping a pattern. Patterns run sandboxed with a 250ms kill switch for catastrophic backtracking. JavaScript (ECMAScript) regex dialect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | Regex flags, e.g. "gi". Default "". | |
| tests | Yes | Strings to test the pattern against. | |
| pattern | Yes | The regex pattern (without slashes). | |
| replacement | No | If given, also return each input with the pattern replaced (supports $1, $<name>). |