regexreplace
Perform regex find-and-replace operations across files while preserving original encoding. Supports single files or directories with glob filtering, capture group replacements, and preview mode.
Instructions
Performs regex find-and-replace across files. Encoding-aware: preserves original file encoding. Supports single file or recursive directory mode with glob filtering. Supports capture group replacement ($1, $2, ${name}). Skips binary files. Use dry_run=true to preview changes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Regular expression pattern to search for | |
| replacement | Yes | Replacement string. Supports $1, $2 capture groups | |
| path | Yes | File or directory to process (absolute path) | |
| glob | No | Glob pattern to filter files when path is a directory (e.g. *.go). Only used when path is a directory | |
| ignore_case | No | Case insensitive search (default false) | |
| dry_run | No | Preview changes without modifying files (default false) | |
| max_files | No | Maximum number of files to process in directory mode. Default: 100 |