UnQTools
Developer Runs in your browser

grep / ripgrep Command Builder

Build grep and ripgrep (rg) commands side-by-side from a visual UI. Toggle flags (ignore-case, whole-word, invert, count, line-numbers, recursive, fixed-string), choose regex flavor (BRE / ERE / PCRE / Rust regex), add file globs and context lines, then test the pattern against sample text live with the correct regex flavor. Per-flag plain-English explanation, grep↔rg translation table, recipe library, history (max 20), shareable URL. 100% client-side — your sample text never leaves the browser.

100% Private Works Offline Instant

About grep / ripgrep Command Builder

Build grep and ripgrep (rg) commands side-by-side from a visual UI. Toggle flags (ignore-case, whole-word, invert, count, line-numbers, recursive, fixed-string), choose regex flavor (BRE / ERE / PCRE / Rust regex), add file globs and context lines, then test the pattern against sample text live with the correct regex flavor. Per-flag plain-English explanation, grep↔rg translation table, recipe library, history (max 20), shareable URL. 100% client-side — your sample text never leaves the browser. Everything runs locally in your browser — your data never leaves your device.

How to use

  1. Enter your input in the tool above.
  2. Adjust any options to your preference.
  3. Use the Copy or Download buttons to save the result.
  4. Everything happens locally — your data never leaves your browser.

FAQ

What's the difference between grep and ripgrep (rg)?

GNU grep is the ubiquitous baseline; ripgrep (rg) is a modern, fast alternative that respects .gitignore and skips hidden/binary files by default. Their flags differ in subtle ways: rg's -i is the same as grep's -i (ignore case), but rg uses --glob instead of --include/--exclude, rg's regex is Rust regex by default (similar to PCRE-ish) while grep defaults to BRE. This builder emits both commands side-by-side from the same intent and shows per-flag translation notes.

Which regex flavors are supported?

Four: grep BRE (default basic regex with \{ \} \( \) metacharacters), grep -E ERE (extended — same as egrep), grep -P PCRE (Perl-compatible — GNU grep only, not on BSD/macOS by default), and ripgrep's Rust regex (a modern PCRE-ish flavor with Unicode by default). The live pattern tester uses JavaScript's RegExp adapted to approximate each flavor — BRE escapes metacharacters that ERE doesn't, ERE adds ( ) { } + ? | without backslash, and PCRE/Rust regex adds \d \w \s shortcuts and lookahead/lookbehind (the tester approximates; always verify with the real tool for production use).

How do file globs work in grep vs ripgrep?

grep uses --include='*.py' and --exclude='*.log' (multiple allowed, glob anchored to filename) and --exclude-dir='node_modules' for directories. ripgrep uses -g/--glob='*.py' (negate with leading !, e.g. -g '!*.log'), -t/--type=py for built-in file types, and -T/--type-not=py to exclude. The builder generates the right flags for whichever tool you target and explains the difference.

Why does ripgrep skip some of my files?

By default rg respects .gitignore files, skips hidden files (those starting with .), and skips binary files. To override: -u (don't skip hidden), -uu (also don't skip .gitignore), -uuu (also search binary files — equivalent to grep -a -r on everything). The builder shows a note recommending -uuu when you toggle 'no filtering', and the explanation panel describes each default-filter behavior so search results are never a mystery.

What extra features does this tool have?

(1) Side-by-side grep + rg commands from the same intent. (2) 8 toggle flags (ignore-case, whole-word, invert, count, line-numbers, recursive, fixed-string, only-matching). (3) 4 regex flavors (BRE / ERE / PCRE / Rust regex). (4) File include/exclude/type globs. (5) Context lines -A/-B/-C. (6) Live pattern tester with match highlighting per flavor. (7) Per-flag plain-English explanation for both tools. (8) grep↔rg translation table with default-behavior notes. (9) Replace preview (rg --replace, preview only). (10) Multiline toggle (rg -U). (11) Recipe library (10 common one-liners). (12) Sample-text presets (log, code, csv, config). (13) Shell-quoting of pattern. (14) Copy command + copy output. (15) localStorage history (max 20). (16) Shareable URL with embedded config + sample text. 100% client-side — your sample text never leaves the browser.

Search tools and actions

Search across all 616 tools, categories, and quick actions.