HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
BurntSushi
ripgrep
Rust2016–2026
BurntSushi / ripgrep

ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

196Distinct people
333Mentions
9Explicit recommenders
69.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

GitHub

Where it is used

  • Visual Studio Code — Visual Studio Code uses ripgrep to power its text search feature, making searches faster. This integrates ripgrep as the engine behind VS Code’s search. Source
  • Eclipse Theia — Eclipse Theia installs and uses ripgrep under its install directory (resources/app/lib/backend/native/ripgrep), requiring extensions to point to that location because Theia places ripgrep in a different directory than VSCode. Source

What people are saying

> I wrote about how to do error handling without libraries literally the day Rust 1.0 was published: https://burntsushi.net/rust-error-handling/ > > That blog did include a…

osiris88 used a recommendation phrase. 9 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 6:28:55 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year333 dated mentions

Observed mentions: 2016-09-23 15:29:58 UTC to 2026-10-05 14:38:02 UTC.

010203040502016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 25 mentions; 1 submissions, 24 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 34 mentions; 3 submissions, 31 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 41 mentions; 5 submissions, 36 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 41 mentions; 1 submissions, 40 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 45 mentions; 3 submissions, 42 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 37 mentions; 2 submissions, 35 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 29 mentions; 1 submissions, 28 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 32 mentions; 3 submissions, 29 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 14 mentions; 2 submissions, 12 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 21 mentions; 3 submissions, 18 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 14 mentions; 4 submissions, 10 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC25124
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC34331
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC41536
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC41140
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC45342
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC37235
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC29128
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC32329
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC14212
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC21318
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC14410

What Hacker News says

32 sources
I don't disagree. It's why I brought this up. It's tricky to use Hyperscan, as-is, as a regex engine in a grep tool for these reasons. I don't mean to claim it is impossible, but there are non-trivial issues you'll need to solve. It's hard to learn too much from hypergrep. It still has some rough spots: $ hgrep -o 'foo.*bar' foobarbar.txt foobarbar.txt 1:[Omitted long line with 1 matches] $ hgrep -M0 -o 'foo.*bar' foobarbar.txt Too few arguments For more information try --help $ hgrep -M 0 -o 'foo.*bar' foobarbar.txt foobarbar.txt 1:[Omitted long line with 1 matches] $ hgrep -M 0 'foo.*bar' foobarbar.txt foobarbar.txt 1:[Omitted long line with 1 matches] $ hgrep -M0 'foo.*bar' foobarbar.txt terminate called after throwing an instance of 'std::invalid_argument' what(): patt
Read the rest
ern not found zsh: IOT instruction (core dumped) hgrep -M0 'foo.*bar' foobarbar.txt Another issue with Hyperscan is that if you enable HS_FLAG_UTF8[1], which hypergrep does[2,3], and then search invalid UTF-8, then the result is UB. > This flag instructs Hyperscan to treat the pattern as a sequence of UTF-8 characters. The results of scanning invalid UTF-8 sequences with a Hyperscan library that has been compiled with one or more patterns using this flag are undefined. That's another issue you'll need to grapple with if you use Hyperscan. PCRE2 used to have this issue[4], but they've since defined the semantics of searching invalid UTF-8 with Unicode mode enabled. ripgrep 14 uses that new mode, but I haven't updated that FAQ answer yet. Hyperscan isn't alone. Many regex engines do not support searching arbitrary byte sequences[5]. And this is why many/most regex engines are awkward to use in a fast grep implementation. Because you really do not want your grep to fall over when it comes across invalid UTF-8. And the overhead of doing UTF-8 checking in the first place (and perhaps let you just skip over lines that contain invalid UTF-8) would make it difficult to be competitive in performance. It also inhibits its usage in OSINT work. [1]: https://intel.github.io/hyperscan/dev-reference/api_files.ht... [2]: https://github.com/p-ranav/hypergrep/blob/ee85b713aa84e0050a... [3]: https://github.com/p-ranav/hypergrep/blob/ee85b713aa84e0050a... [4]: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#why... [5]: https://github.com/BurntSushi/rebar/blob/96c6779b7e1cdd850b8...
In Ugrep – a more powerful, fast, user-friendly, compatible grep
Interesting, it supports an n-gram indexer. ripgrep has had this planned for a few years now [1] but hasn't implemented it yet. For large codebases I've been using csearch, but it has a lot of limitations. Unfortunately... I just tried the indexer and it's extremely slow on my machine. It took 86 seconds to index a Linux kernel tree, while csearch's cindex tool took 8 seconds. [1] https://github.com/BurntSushi/ripgrep/issues/1497
In Ugrep – a more powerful, fast, user-friendly, compatible grep
> Surely you can understand the difference between omitting less interesting points along a timeline and literally changing what was recorded retroactively for points that have been selected as meaningful along that timeline? Yes? But that isn't what you said. You said "actual" history. Using that phrasing makes this conversation extremely difficult because it doesn't acknowledge that our positions are different by degrees than by categories. You said "actual" as-if it was somehow inherently better because it's the "actual" history. But it isn't the "actual" history. So your communication on this point just becomes befuddled. Please be more precise. > Not when "curation" is revision after the fact. How many times do we have to go over this? Unless you're recording every single keystroke, then you are also doing "revision after the fact."
Read the rest
There are differences between our approaches, for sure, but "revision after the fact" does not capture them. > When I'm trying to answer the question "how did this ever work?" or "what were they thinking" and the answer is "it didn't", because they committed something different, this makes troubleshooting and determining intent infinitely more difficult and complicated. What are you talking about, "committed something different"? I don't take a PR, rewrite history and then merge it. I rewrite the history, push it back up to the PR branch and only merge (via rebase if appropriate, or sometimes via squash) when CI passes. The collection of commits still passes. CI doesn't guarantee that each individual commit does, but I already acknowledged and discussed that downside. The curation of commits is specifically all about making intent and understanding the change easier. That's the entire point! > I've definitely spent days of my life trying to track down inexplicable problems in other people's code as a result of their rebasing, that cannot be fully explained because the history of what they actually committed was erased. I can't even conceive of example of this. Can you give one? Even if it's hypothetical, that's fine. To be clear, I can imagine the following examples of things going awry: * Squashing is used which causes many commits to get squashed into one, and thus can make the history of changes less clear depending on the commits. For example, if a PR contains 2 commits where there's a thousand lines as a result of adding a new function parameter in the first commit, and then a second commit with one additional line calling the function using that new parameter in an interesting way, then squashing those two commits into 1 will lead to history that is less clear. But this is why I don't advocate for squash & merge in all cases. * Since CI doesn't run on every commit, if you need to revert a PR the merged multiple commits via rebasing only, then you might need to revert all of the commits that came in from that PR individually. That can be a pain and it can be difficult to discover which commits you need to revert. * Since CI doesn't run on every commit, it's possible that `git bisect` can be more annoying than it otherwise would be. Maybe tests don't build on one commit. Then you need to do `git bisect skip`. But none of those are about browsing the search history when using rebase & merge. I can't even begin to imagine a single example of browsing the search history where I would specifically want an "actual" accounting of the history without any intentional curation. In literally every instance of me browsing source history in over 20 years of programming, I cannot imagine a single instance where I found curation to be unhelpful and wished that the source history was somehow more faithful to how the programmer arrived at the change instead of focusing on communicating the change to other programmers. > What are you even calling "continuous integration" if you're not running tests on every commit? This also highlights that if you were doing that, which I do, and you should be, that history becomes misleading after a rebase unless you re-run tests against every commit. If you open a PR on a GitHub project with 5 commits, GitHub Actions will not run on each commit by default. I'm not aware of easy way of changing that behavior. If you "rebase & merge" that PR, CI still won't run on every commit merged. Here's an example from one of my projects, where you can clearly see that not every commit has a green checkmark: https://github.com/BurntSushi/ripgrep/commits/master/ I run dozens of projects this way. I've never had a major issue because it just isn't a big deal if one commit now and then doesn't pass tests. If it were a bigger deal, then I'd absolutely either reconsider my curation or invest more in improving CI tooling. > Again, do you not understand the difference between capturing something that actually occurred and changing that capture to be something that never occurred? We're speaking past each other. I don't know how else I can explain that there is no such thing as "capturing what actually occurred." You keep saying that, but even in that case, you aren't capturing what actually occurred. You're capturing an ad hoc curation of what actually occurred. > Your curation is literally a series of lies about the code (that I understand you may find easier to read and more convenient for the goal of forming a high level understanding of the changes over time), whereas what I prefer is a faithful recording of history. The integrity of this captured history matters a lot when you're dealing with executable, deterministic code, and the outcome of running a program can be changed by your "curation". You don't have a faithful recording of history though. Your source history is also a lie. And the thing you call a "faithful recording of history" is more like a meandering series of "fix typo" or "fix lint" or whatever commits. The only benefits it has that I'm aware of are the following: * It's easier, in the sense that you don't pay any attention to how a patch series is structured. You just code and commit and don't worry about anything. To me, this is like writing code without caring about whether someone else (including you) can read & understand it. Which is a thing. Lots of people do that. Let's just be open and transparent about it. * In some cases, there is less friction with the tooling. I still don't think you've actually tried the type of curation I'm talking about. On the other hand, I arrived at my position on curation after years of doing your approach of capturing a "faithful recording of history" and realized it was just about useless.
In The merge vs. rebase debate
No. Cargo does. The `build.rs` is basically a Cargo hook that gets compiled as a Rust program and executed just before the ripgrep binary is compiled. It lets you do things like set linker flags[1] so that you can embed an XML manifest into the binary on Windows to enable "long path support." ripgrep's build.rs used to do more, like build shell completions and the man page. But that's now part of ripgrep proper. e.g., `rg --generate man` writes roff to stdout. [1]: https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c5... [2]: https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c5...
In Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
A search for `rg -e foo -e bar` will return lines that match either foo or bar. Some lines may have both, but it isn't required. The standard way to run "AND" queries is through shell pipelines. That is, `rg foo | rg bar` will only print lines containing both. But composition usually comes with costs. The output reverts to the standard grep format and it doesn't interact nicely with contextual options like -C/--context. See: https://github.com/BurntSushi/ripgrep/issues/875
In Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
Author of ripgrep here. Yes, qgrep uses indexing, which will always give it a leg up over other tools that don't use indexing. But of course, now you need to setup and maintain an index. The UX isn't quite as simple as "just run a search." But there isn't much of a mystery here. Someone might neglect to use qgrep for exactly the same reason that "grep is fast enough for me" might prevent someone from using ripgrep. And indeed, "grep is fast enough" is very much true in some non-trivial fraction of cases. There are many many searches in which you won't be able to perceive the speed difference between ripgrep and grep, if any exists. And, analogously, the difference between qgrep and ripgrep. The cases I'm thinking of tend to be small haystacks. If you have only a small thing to search, then perhaps even the speed of a "naive" grep is fast
Read the rest
enough. So if ripgrep, say, completes a search of the Linux kernel in under 100ms, is that annoying enough to push you towards a different kind of tool that uses indexing? Maybe, depends on what you're doing. But probably not for standard interactive usage. This is my interpretation anyway of your wonderment of (in your words) "why people forget the qgrep option." YMMV. I have flirted with the idea of adding indexing to ripgrep: https://github.com/BurntSushi/ripgrep/issues/1497 > this above all true UNLESS you need multi-line matches with UTF8, where ripgrep is not so fast, because it needs to fall back to the other PCRE2 lib That's not true. Multiline searches certainly do not require PCRE2. I don't know what you mean by "with UTF8," but the default regex engine has Unicode support. PCRE2 is a fully optional dependency of ripgrep. You can build ripgrep without PCRE2 and it will still have multiline search support.
In Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

Showing the 15 most recent of 32 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.