Ripgrep Search and Replace Preview
search-and-replacePreview find-and-replace results across files with ripgrep without altering them. Validate regex capture groups ($1, $2, ${name}) before applying changes.
Instructions
Read-only preview of search-and-replace results using ripgrep. Does NOT modify files. Useful for previewing replacements and testing capture groups ($1, $2, ${name}).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Glob pattern to filter files | |
| path | Yes | Directory or file to search | |
| pattern | Yes | Search pattern (regex by default) | |
| fileType | No | Filter by file type (e.g. 'ts', 'py') | |
| maxDepth | No | Maximum directory traversal depth | |
| noIgnore | No | Do NOT respect .gitignore rules (search files that are normally ignored) | |
| multiline | No | Enable multiline matching (for function signatures, import blocks, etc.) | |
| wordMatch | No | Only match whole words | |
| maxResults | No | Maximum matches per file | |
| fileTypeNot | No | Exclude file type (e.g. 'json') | |
| replacement | Yes | Replacement string (supports $1, $2, ${name} for capture groups) | |
| fixedStrings | No | Treat pattern as a literal string | |
| onlyMatching | No | Show only the matched/replaced text instead of the full line (useful for extracting captured groups) | |
| caseSensitive | No | true = case-sensitive, false = case-insensitive, omit = smart-case | |
| includeHidden | No | Include hidden files and directories | |
| maxCharacters | No | Maximum characters in the result. Truncated with summary if exceeded. | |
| followSymlinks | No | Follow symbolic links |