A deep dive into ripgrep

Fast by default, and quiet about what it skipped.
Most ripgrep confusion is not a bad regex — it's a file that never got opened.

Why ripgrep "missed" your file

Before ripgrep reads a single byte, four gates decide whether a file is even opened. Each gate has the flag that opens it. Hover a gate to read what it drops; click it to filter the flag list below.

How ripgrep decides which files to open Files on disk pass through four gates — version-control ignore rules, hidden files, type and glob filters, then binary and size limits — before ripgrep searches what is left; input piped on stdin bypasses every gate. All files under the paths you named rg "pattern" src/ tests/ Drops .gitignore · .ignore · .rgignore -u · --no-ignore-vcs Drops dotfiles and dot-directories --hidden · -uu Keeps only your types and globs -t · -T · -g · --max-depth Drops binary and oversized -a · -z · --pre Files rg opens rg --files stdin — no files, no gates LEGEND Gate — narrower band, fewer files What survives Bypasses the funnel flags on the right open each gate
Hover a band to read what it drops. Click it to filter the flags below.

From pattern to output

Once a file is open, two more decisions shape what you see: which regex engine runs, and what ripgrep prints when it hits. Click any box to filter the flags below.

From pattern to output in ripgrep A pattern runs on either the fast default engine or the PCRE2 engine enabled by -P; each match can then be printed with surrounding context, reduced to the matched text, counted, or reshaped for a pipe. PATTERN What you typed -S · -w · -F DEFAULT Rust regex engine fast · no lookaround -P PCRE2 engine lookaround · backrefs MATCH A matching line -U · -v · -e Read it in context -C · -A · -B · --trim Extract the value -o · -r '$1' · -IN Count the hits -c · --count-matches Send it down a pipe -l0 · --vimgrep · --json LEGEND The match itself Opt-in — off unless you ask Path taken only with -P Default path
Hover a box to read what it changes. Click it to filter the flags below.

Every flag, filtered

Search by flag, command, or what you want to do. Click any card to copy it.

The twenty flags

The ones worth holding in your head. The four in cyan are the everyday defaults — put --smart-case in your config and you can stop typing one of them.