Skip to content

An alternative to sed. Painless regex from the CLI powered by the .NET regex engine.

License

Notifications You must be signed in to change notification settings

yellowsink/reggie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reggie

AUR package

A regex replace CLI tool, as an alternative to sed with a simpler usage.

Other tools I tried had issues - some didnt support getting group by index in the replace pattern, some didnt allow inserting the original text as part of the replace pattern, etc., so I made my own!

This tool uses the powerful and fast regex engine in .NET.

echo "this is a test of reggie, a regular expression CLI tool" > test.txt

cat test.txt
this is a test of reggie, a regular expression CLI tool

reggie test.txt "reg.*n" "a regex replace" -
this is a test of a regex replace CLI tool

Examples

Patch usrbg for Vizality (based on my previous script here) (this was tested with fish, \n may work differently in other shells)

reggie usrbg.css '\\[data-user-id="(.{17,18})"\\]:not\\(img\\)' '$&,'\n'[vz-user-id="$1"]:not(img)' patched.css
mv patched.css usrbg.css

But I want find (like grep) not replace

Good news! - ripgrep has you covered :) https://github.com/BurntSushi/ripgrep

About

An alternative to sed. Painless regex from the CLI powered by the .NET regex engine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages