suggest_tests
Generate verified should-match and should-not-match test strings for a regex by running examples in the real engine, exposing surprising matches that reveal unanchored or overly broad patterns.
Instructions
Generate should-match and should-not-match test strings for a regex, verified by running.
Builds examples from the pattern's structure (each alternative, quantifier minimum
and maximum, class boundaries) plus mutations (deleted or replaced characters, junk
prefix/suffix, trailing newline, case swap, off-by-one repeat counts), then RUNS all of
them in the real engine. Only confirmed examples are listed as tests. Mutations that
unexpectedly still match are listed as SURPRISES - they often expose a missing anchor,
a $ that accepts a trailing newline, or a class that is too broad. Uses search
semantics (match anywhere), and says when the pattern is not anchored.
engine: "python" (default), "javascript" or "regex" (must be available).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | ||
| engine | No | python | |
| pattern | Yes | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |