Skip to content

An alternative to grep which uses JavaScript's Regex, supports a match and a match-and-replace

Notifications You must be signed in to change notification settings

branneman/jsgrep-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsgrep-cli

Build Status Known Vulnerabilities

An alternative to grep which uses JavaScript's Regex, supports a match and a match-and-replace

Installation

npm i jsgrep-cli -g

Example

Match input from stdin, return any matching line:

ls -al ~ | jsgrep " \.[a-z]+rc$"

Match and replace lines from stdin. Capturing groups are exposed as $1, $2... variables (1-indexed), and must probably be escaped to prevent being interpreted by your shell:

ls -al ~ | jsgrep ".+ (\.[a-z]+rc$)" "\$1"

Passing flags (default i):

ls -al ~ | jsgrep " \.[a-z]+rc$" --flags iu

About

An alternative to grep which uses JavaScript's Regex, supports a match and a match-and-replace

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published