32 releases (12 breaking)

0.15.0 Dec 18, 2023
0.14.3 Aug 9, 2023
0.14.2 Jul 24, 2023
0.12.2 Mar 22, 2023
0.4.3 Jun 24, 2020

#189 in Text processing

Download history 3/week @ 2023-12-21 8/week @ 2023-12-28 7/week @ 2024-01-04 2/week @ 2024-01-11 117/week @ 2024-02-22 312/week @ 2024-02-29 4/week @ 2024-03-07 2/week @ 2024-03-14 46/week @ 2024-03-28 6/week @ 2024-04-04

55 downloads per month

Unlicense OR MIT OR Apache-2.0 and LGPL-3.0

1MB
5K SLoC

crate documentation Average time to resolve an issue Percentage of issues still open

repgrep (rgr)

An interactive replacer for ripgrep.

This is an interactive command line tool to make find and replacement easy. It uses ripgrep to find, and then provides you with a simple interface to see the replacements in real-time and conditionally replace matches.

Some features:

  • ⚡ Super fast search results
  • ✨ Interactive interface for selecting which matches should be replaced or not
  • 🕶️ Live preview of the replacements
  • 🧠 Replace using capturing groups (e.g., when using /foo (\w+)/ replace with bar $1)
  • 🦀 and more!

Supported file encodings:

  • ASCII
  • UTF8
  • UTF16BE
  • UTF16LE

Other encodings are possibly supported but untested at the moment. See this issue for more information.

Usage

After installing, just use rgr (think: rg + replace).

The arguments are:

rgr <rg arguments> # See `rgr --help` for more details

Here's an example where we ran the command:

rgr -C5 dreamcast

And have entered the replacement flycast:

demo using rgr

Installation

First and foremost, make sure you've installed ripgrep (AKA: rg). To do so see the ripgrep installation instructions.

Precompiled binaries

See the releases page for pre-compiled binaries.

Via Cargo

NOTE: The minimum Rust version required is 1.72.0.

cargo install repgrep

Via Pacman (Arch Linux)

repgrep can be installed from the official repositories using Pacman.

pacman -S repgrep

Via MacPorts (macOS)

repgrep can also be installed on macOS using MacPorts:

sudo port install repgrep

More info here.

From Source

NOTE: The minimum Rust version required is 1.72.0.

git clone https://github.com/acheronfail/repgrep/
cd repgrep
cargo install --path .

License: Unlicense OR MIT OR Apache-2.0

Dependencies

~14–27MB
~362K SLoC