A regex debugger for the terminal — step-through execution, 3 engines, code generation, and live stream filtering
Test and debug regular expressions without leaving your terminal. Written in Rust.

Press F1 in the app for a multi-page cheat sheet.
rgx is useful if you:
echo "log" | rgx -p '\d+' | sort) — regex101 can't do this.regex crate vs. PCRE2 without guessing.If you write regex a few times a month and regex101.com works fine for you, it probably still will. rgx is strongest for developers doing regex-heavy work in terminal-centric workflows.
cargo install rgx-cli # crates.io
brew install brevity1swos/tap/rgx # Homebrew
yay -S rgx-cli # AUR
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/brevity1swos/rgx/releases/latest/download/rgx-installer.sh | sh
Prebuilt binaries are also on GitHub Releases.
Build from source / enable PCRE2
# From source
git clone https://github.com/brevity1swos/rgx.git
cd rgx && cargo install --path .
# With PCRE2 engine (requires libpcre2-dev)
cargo install rgx-cli --features pcre2-engine
See docs/advanced.md for the PCRE2 security note.
rgx # interactive TUI
rgx '\d{3}-\d{3}-\d{4}' # start with a pattern
echo "Call 555-123-4567" | rgx '\d+' # stdin as test string
rgx -p -t "error 404" '\d+' # batch mode (non-interactive)
cat app.jsonl | rgx filter --json '.msg' 'error' # live stream filter on a JSON field
Full flag reference, piping recipes, and rgx filter + --json usage:
docs/usage.md.
regex (default), fancy-regex (lookaround / backrefs), PCRE2 (+ recursion / conditionals)rgx filter streams stdin/file through a regex TUI, with --json JSONL-field extractionrgx --test file.toml validates patterns against assertions in CI-p with --count, --group, --json, --color, grep-like exit codes-P prints the final pattern after an interactive session (eval $(rgx -P))-w) — track in git--completions bash|zsh|fish| Engine | Features | Dependencies |
|---|---|---|
Rust regex (default) |
Fast, linear time, Unicode | Pure Rust |
| fancy-regex | + lookaround, backreferences | Pure Rust |
| PCRE2 | + possessive quantifiers, recursion, conditionals | libpcre2 |
Full matrix and comparison against other tools: docs/advanced.md.
See CONTRIBUTING.md.
Licensed under either of
at your option.