Test a regular expression
regex_testTest JavaScript regular expressions against strings, returning match positions and capture groups. Also preview replacements using standard patterns.
Instructions
Runs a JavaScript regular expression against a string and returns every match with its character offset, positional capture groups, and named capture groups. Optionally performs a replacement so you can preview the substituted output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | Regex flags such as "i" or "im". The g flag is always applied. | |
| input | Yes | The text to match against. | |
| pattern | Yes | The regular expression source, without delimiting slashes. | |
| replacement | No | If provided, also returns the input with each match replaced by this string. Supports $1, $<name>, and the other standard String.replace patterns. |