Skip to content
Minimal sed-like tool with JS regexp syntax
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
reg

README.md

reg

Minimal sed-like tool for text replacements using JS regex syntax.

Cause it's easier to reimplement sed than to remember its regex syntax.

Usage

reg <flags> <regex> <replacement>

This maps directly to Javascript's String.replace function:

var regex = new RegExp(<regex>, <flags>);
str.replace(regex, <replacement>);

Examples

cat /etc/passwd | reg :.*

cat /etc/passwd | reg (.*?):.* "User: \$1"
You can’t perform that action at this time.