lasr

Crates.iolasr
lib.rslasr
version0.3.0
created_at2025-07-22 12:10:15.70382+00
updated_at2025-07-27 21:08:43.643762+00
descriptionLive Action Search and Replace
homepagehttps://github.com/rcorre/lasr
repository
max_upload_size
id1763462
size632,309
Ryan Roden-Corrent (rcorre)

documentation

README

Live Action Search and Replace (LASR)

When performing a global search-and-replace using e.g. sed, it can be difficult to hone in on the exact correct pattern. lasr makes this easier by showing live results as you type.

Example of using lasr

Installation

Binary artifacts can be downloaded from the releases page.

If you have a rust toolchain, you can install from source:

cargo install lasr

Usage

Simply run lasr to start a search-and-replace in the current directory. You may run lasr <path> to search a different directory. This will open a TUI where you can start typing a search pattern and see live matches below. Once you are happy with the search pattern, press Tab to start editing the replacement pattern. Finally,

Syntax

The pattern syntax is based on the rust regex crate. The replacement syntax is based on the replace method in that crate.

The following replacements are available:

Text Description
$0, ${0} Whole match
$1, ${1} First capture
$foo, ${foo} Capture group named "foo"

Similar tools

  • sad allows you to approve/reject each replacement, but must be re-run each time you change the pattern.
  • sd provides a simpler CLI alternative to sed, but is not interactive.
Commit count: 0

cargo fmt