Crates.io | lasr |
lib.rs | lasr |
version | 0.3.0 |
created_at | 2025-07-22 12:10:15.70382+00 |
updated_at | 2025-07-27 21:08:43.643762+00 |
description | Live Action Search and Replace |
homepage | https://github.com/rcorre/lasr |
repository | |
max_upload_size | |
id | 1763462 |
size | 632,309 |
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.
Binary artifacts can be downloaded from the releases page.
If you have a rust toolchain, you can install from source:
cargo install lasr
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,
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" |