Fast line-oriented 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 automatically respects gitignore rules and skips hidden files, directories, and binary files by default, though this filtering can be disabled with rg -uuu. The tool provides first-class support across Windows, macOS, and Linux platforms.
ripgrep includes comprehensive search capabilities beyond basic pattern matching. It supports file type filtering with commands like rg -tpy foo to limit searches to Python files or rg -Tjs foo to exclude JavaScript files. The tool can search files in various text encodings (UTF-16, latin-1, GBK, EUC-JP, Shift_JIS) using the -E/--encoding flag and can handle compressed files in common formats (brotli, bzip2, gzip, lz4, lzma, xz, zstandard) with the -z/--search-zip flag.
The tool offers optional PCRE2 regex engine support via -P/--pcre2 or --auto-hybrid-regex flags, enabling look-around and backreference patterns not supported in the default engine. ripgrep also provides rudimentary replacement capabilities, arbitrary input preprocessing filters for tasks like PDF text extraction, and configuration file support. Performance benchmarks show ripgrep consistently outperforming tools like grep, ag, and ack across various workloads, particularly excelling in Unicode-enabled searches where it maintains speed advantages.
