One thing I wish ripgrep had is support for AND conditions.
rg -P '(?=.*pat1)(?=.*pat2)(?=.*pat3)'
You could create a shell function shortcut if you need to use it often. But yeah, having it as a feature of the tool itself would be nice.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.
Otherwise it would look like this:
# rg nokogiri | rg linux
<stdin>:11:Gemfile.lock:647: nokogiri (1.15.5-x86_64-linux)
But that is a me problem.The workaround is of course just to pipe into grep instead.
Still losing the coloring but you can't have everything.
rg nokogiri.*linuxI wanted and boolean syntax mixed with fzf instant search. It’s not as fast as ripgrep of course but it’s not solving the same problem.