When comparing ripgrep vs Grep, the Slant community recommends ripgrep for most people. In the question“What are the best open source tools for searching source code?” ripgrep is ranked 2nd while Grep is ranked 3rd. The most important reason people chose ripgrep is:
ripgrep has performance similar to raw grep but provides similar level of usability as The Silver Searcher or ACK.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Fast
ripgrep has performance similar to raw grep but provides similar level of usability as The Silver Searcher or ACK.
Pro Supports VCS ignore files
ripgrep can speed up by ignoring files matched by pattern in ".rgignore" (deprecated), ".ignore" (since rg-v0.2.0), and VCS ignore files (e.g., currently only ".gitignore").
Pro Speedy even with Unicode (UTF-8) searches
Pro Lock-free parallel recursive directory search
Pro ripgrep lets you only search certain types of files via file type whitelist
Pro Preinstalled on every Unix like system
Pro Searches any text file
Pro Reads from STDIN
You can search the output of any command just by piping into grep
.
Pro Searches multiple files
It is possible to instruct grep to search through multiple files specified on the command line or entire directory trees.
Pro Full PCRE regex support
Pro Fast
Searches through large collections of files well before the expected time.
Cons
Con Does not support encodings other than UTF-8
If you need to search files with text encodings other than UTF-8 (like UTF-16), then ripgrep won’t work. ripgrep will still work on ASCII compatible encodings like latin1 or otherwise partially valid UTF-8. ripgrep may grow support for additional text encodings over time.
Con Does not support decompression
If you need to search compressed files, ripgrep doesn’t try to do any decompression before searching.
Con Does not support arbitrary lookahead/lookbehind assertions
However, it's supported since ripgrep v0.10.0 (2018-09-07)
https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md#0100-2018-09-07
Con Does not support backreferences
However, it's supported since ripgrep v0.10.0 (2018-09-07)
https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md#0100-2018-09-07
Con Hard to filter by file type
Want to search for my_function in PHP files only? find . -name '*.php' -exec grep my_function '{}' ;
Con Multiple, not fully compatible, implementations
The most known 2 are: BSD and GNU implementations which slightly differ in their capabilities and performance.