Rex is a command line playground for regular expressions similar to playground section on ihateregex.io.
With the repository checked out:
$ make # make install
This will install everything into
/usr/local by default so you might need root
access to do this. Alternatively you can install into a different directory by
PREFIX. For example:
$ make install PREFIX="$HOME/.local"
For packagers: you can set
DESTDIR to install into a different system root,
make install DESTDIR="$pkgdir" PREFIX=/usr on Arch and Alpine.
$ rex [flags] [file]
file where each line is a test match. If missing, the text is read
from standard input.
The interface consists of an input field with a regular expression to use, and the file colored depending on what lines match that regular expression.
Those can be switched between using
Escape exits the
File matches can be scrolled using Vi keys:
j - down,
k - up, etc. Input
field supports readline-like bindings: reference.
The following options are supported:
-i REGEX) - default value for the input field (default:
-p) - print the input after exit (default:
-V) - show version number
-h) - show the help message
The following values can be accepted by boolean flags:
$ git config format.subjectPrefix "PATCH rex"