Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. ruplacer

ruplacer

BSD-3-ClauseRustv0.10.0

A command-line tool to find and replace text in source files with regex support and case preservation.

GitHubGitHub
488 stars24 forks0 contributors

What is ruplacer?

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.

Target Audience

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.

Value Proposition

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.

Overview

Find and replace text in source files

Use Cases

Best For

  • Performing large-scale code refactoring with preview before committing changes
  • Batch renaming variables or functions across multiple source files safely
  • Updating literal strings or patterns in codebases while preserving case conventions
  • Filtering replacements by file type or glob patterns similar to ripgrep
  • Replacing text in projects with complex .gitignore rules without manual file listing
  • Using regex with capture groups for advanced pattern matching and replacement

Not Ideal For

  • Real-time editing workflows where immediate application of changes is required, as Ruplacer mandates a dry-run preview first.
  • Projects relying on IDE-integrated refactoring tools that offer semantic code analysis and live previews.
  • Teams that exclusively prefer graphical user interfaces over command-line utilities for batch operations.
  • Scenarios requiring undo functionality after replacements, as Ruplacer lacks built-in rollback features.

Pros & Cons

Pros

Dry-Run Safety

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.

Advanced Regex Support

Uses Rust's regex engine for pattern matching, with support for capture groups referenced as $1, $2 in replacements, enabling complex text transformations.

Case Preservation

The --preserve-case flag intelligently maintains original casing styles like snake_case or CamelCase in replacements, useful for consistent code refactoring.

File Filtering

Allows selecting or ignoring files by type or custom glob patterns, similar to ripgrep, and honors .gitignore rules, making targeted replacements easy.

Cons

Rust Regex Limitations

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.

No Undo Functionality

Once changes are applied with --go, there is no built-in undo feature, requiring reliance on external backups or version control systems for rollback.

Installation Dependency

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.

Frequently Asked Questions

Quick Stats

Stars488
Forks24
Contributors0
Open Issues9
Last commit6 months ago
CreatedSince 2017

Tags

#regex#command-line-tool#sed#grep#file-filtering#awk#command-line#rust#code-refactoring#text-replacement

Built With

R
Rust

Included in

Rust56.6k
Auto-fetched 10 hours ago

Related Projects

ripgrep-allripgrep-all

rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.

Stars9,831
Forks217
Last commit5 months ago
KreuzbergKreuzberg

Polyglot document intelligence with a Rust core: extract text, metadata, images, tables, and structured data from 106 formats across 140 file extensions, plus code intelligence for 371 languages. Fifteen bindings, with CLI, REST API, and MCP server.

Stars9,275
Forks582
Last commit14 hours ago
grexgrex

A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases

Stars8,182
Forks198
Last commit6 months ago
MelodyMelody

Melody is a language that compiles to regular expressions and aims to be more readable and maintainable

Stars4,744
Forks59
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub