re#
a grep that can search for multiple words at once and across paragraphs, powered by the RE# regex engine.
re#is a valid binary name on unix -#only starts a comment after whitespace. also available asresharpfor compatibility.
Quickstart
|
Multi-Word Search
-W finds lines containing all given words:
--not excludes lines matching a pattern:
Paragraph Search
-p searches paragraphs (blocks separated by blank lines) instead of lines:
Regex Algebra
& (intersection) and ~ (complement) let you combine constraints in a single pattern.
_ matches any character (like . but works across the algebra).
# hex strings that contain both a digit and a letter
# lines with "error" AND "timeout" (same as -W, but inline)
# match identifiers 8-20 chars long containing "config"
# complement: lines NOT containing "debug"
try patterns interactively in the web playground.
Finding Leaked Keys
# AWS keys
# lines with key=value where the key name looks like a secret
# github/gitlab/slack tokens
The Underscore
_ is the universal wildcard, not a literal underscore.
Differences From Ripgrep
| ripgrep | re# | why |
|---|---|---|
-a / --text |
-uuu |
-a is taken by --and |
_ is literal |
_ is wildcard |
use -R or \_ for literal |
| pattern is standard regex | pattern has algebra | &, ~, _ are operators; -R for compatibility mode |
Exit Codes
0 match, 1 no match, 2 error
Install
Prebuilt Binaries
download from GitHub releases:
resharp-x86_64-linux(x86_64 linux)resharp-aarch64-linux(aarch64 linux)resharp-aarch64-macos(aarch64 macos)resharp-x86_64-windows.exe(x86_64 windows)
Nix
or in a flake:
inputs.resharp.url = "github:ieviev/resharp-cli";
the nix package also installs a re# symlink and shell completions.
Cargo
License
MIT