A command-line tool to find and replace text in source files with regex support and case preservation.
Ruplacer is a command-line utility for safely finding and replacing text across source code files. It walks through directories, respects .gitignore rules, and provides a dry-run preview before applying changes, making it a reliable tool for code refactoring and batch text editing.
Developers and system administrators who need to perform safe, batch text replacements across codebases, particularly those working with multiple file types and wanting to avoid accidental file corruption.
Developers choose Ruplacer for its safety-first approach with mandatory dry-run previews, robust regex support using Rust's regex engine, and intelligent file handling that automatically skips binary and non-UTF-8 files to prevent data loss.
Find and replace text in source files
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Defaults to a non-destructive preview mode, showing all proposed changes without writing to disk, and requires the explicit --go flag to apply, preventing accidental file corruption.
Uses Rust's regex engine for pattern matching, with support for capture groups referenced as $1, $2 in replacements, enabling complex text transformations.
The --preserve-case flag intelligently maintains original casing styles like snake_case or CamelCase in replacements, useful for consistent code refactoring.
Allows selecting or ignoring files by type or custom glob patterns, similar to ripgrep, and honors .gitignore rules, making targeted replacements easy.
Uses Rust regex, which differs from Perl-style regular expressions (e.g., group references as $1 instead of \1), potentially confusing users familiar with other regex flavors.
Once changes are applied with --go, there is no built-in undo feature, requiring reliance on external backups or version control systems for rollback.
The primary installation method requires Rust and cargo, which can be a barrier for users without the Rust toolchain, though pre-compiled binaries are offered as an alternative.