searchAndReplace
Find and replace text or regex patterns across workspace files with support for capture groups, file glob filtering, and dry-run previews.
Instructions
Find and replace across workspace files. Supports regex with capture groups. Returns modified files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Text or regex pattern to search for | |
| replacement | Yes | Replacement text. For regex mode, supports $1, $2, etc. capture group references. | |
| glob | No | File glob pattern to limit scope (e.g. '**/*.ts', 'src/**/*.py'). Omit to search all text files. | |
| isRegex | No | Treat pattern as a JavaScript regex. Default: false (literal string match). | |
| caseSensitive | No | Case-sensitive match. Default: true. | |
| dryRun | No | Preview changes without writing files. Default: false. | |
| includeIgnored | No | Search inside .gitignored files (e.g. node_modules, build output). Default: false. |