Test a regular expression
test_regexValidate a regular expression against sample text to see matches, positions, and capture groups; invalid patterns return clear error messages.
Instructions
Run a regular expression against text and report every match with its position and capture groups. An invalid pattern comes back as an error message rather than an exception. Use it to check a pattern actually does what it looks like it does.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to search. | |
| flags | No | Any of i (ignore case), m (multiline), s (dotall), x (verbose). | |
| pattern | Yes | The regular expression, in Python syntax. |