BurntSushi/ripgrep
Packages
Active contributors: Andrew Gallant
ripgrep is a Cargo workspace with one binary crate (ripgrep, the rg executable) and nine library crates under crates/. Most of ripgrep's logic is in those libraries; the binary is glue that parses flags and wires them together.
The library crates are also published independently to crates.io and have downstream users beyond ripgrep itself (e.g., globset is used by Cargo, ignore by build tools).
Workspace layout
| Crate | Path | Purpose | Dedicated page |
|---|---|---|---|
ripgrep |
crates/core |
The rg binary: CLI parsing, search drivers |
core |
grep |
crates/grep |
Re-export facade over the other crates | grep |
grep-matcher |
crates/matcher |
Generic Matcher trait for regex implementations |
matcher |
grep-regex |
crates/regex |
Matcher impl backed by Rust's regex crate |
regex |
grep-pcre2 |
crates/pcre2 |
Matcher impl backed by PCRE2 (optional) |
pcre2 |
grep-searcher |
crates/searcher |
Line-oriented search engine | searcher |
grep-printer |
crates/printer |
Standard / JSON / Summary output formatters | printer |
grep-cli |
crates/cli |
CLI utilities: stdin handling, decompression, pattern files | cli |
ignore |
crates/ignore |
Recursive directory walker that respects ignore rules | ignore |
globset |
crates/globset |
Single glob and glob-set matching | globset |
Dependency layering
graph TD
rg[ripgrep binary - crates/core] --> grep
rg --> ignore
grep --> grep_cli
grep --> grep_matcher
grep --> grep_pcre2
grep --> grep_printer
grep --> grep_regex
grep --> grep_searcher
grep_searcher --> grep_matcher
grep_regex --> grep_matcher
grep_pcre2 --> grep_matcher
grep_printer --> grep_matcher
grep_printer --> grep_searcher
ignore --> globsetLines flow from dependent to dependency. globset and grep-matcher are at the bottom; nothing in the workspace depends on crates/core other than the binary it produces.
Versioning
Each library crate has its own version number, separate from the ripgrep binary's version. Versions are bumped only when a release is cut for that specific crate. The #:version marker comment in Cargo.toml is what RELEASE-CHECKLIST.md greps for when bumping.
Latest tagged versions (as of writing):
ripgrep15.1.0grep0.4.1grep-cli0.1.12grep-matcher0.1.8grep-pcre20.1.9grep-printer0.3.1grep-regex0.1.14grep-searcher0.1.16globset0.4.18ignore0.4.25
Where to start
If you want to understand ripgrep top-down, read in this order:
- core — what the
rgbinary does - matcher — the trait everyone implements or uses
- searcher — the search engine
- regex — the default matcher implementation
- printer — the output formatters
- ignore — directory walking and
.gitignorerules - globset — what
ignoreuses for glob matching
The smaller crates (grep, cli, pcre2) can be read in any order.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.