Fast regex search tool that recursively searches directories with automatic gitignore and binary file filtering
ripgrep is a line-oriented search tool that recursively searches directories for regex patterns. It respects gitignore rules by default and automatically skips hidden files, directories, and binary files. The tool can be configured to disable all automatic filtering using rg -uuu for comprehensive searches.
ripgrep supports file type filtering with commands like rg -tpy foo to search only Python files or rg -Tjs foo to exclude JavaScript files. It includes context display, multiple pattern matching, Unicode support, and optional PCRE2 regex engine support via -P/--pcre2 for advanced features like look-around and backreferences. The tool can search compressed files (brotli, bzip2, gzip, lz4, lzma, xz, zstandard) with -z/--search-zip and supports various text encodings including UTF-16, latin-1, GBK, and others.
The tool provides configuration file support and preprocessor filters for handling PDFs, encryption, or automatic encoding detection. Performance benchmarks show ripgrep significantly outperforming alternatives like grep, ag, and ack on large codebases, with cross-platform support for Windows, macOS, and Linux through binary downloads for each release.
