Compare default engine vs PCRE2 behavior.

Section: Debug missing or surprising results

Verify advanced regex needs

bash
bash
rg '(?<=id=)\d+' file.txt && rg -P '(?<=id=)\d+' file.txt
Explanation

If the default engine fails on look-around or backreferences, switch to PCRE2.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Debug missing or surprising results
Inspect filtering decisions
Show diagnostics about ignores, globs, and traversal.
OpenIn sheetbashsame section
See what happens with binary detection
Override binary skipping during diagnosis.
OpenIn sheetbashsame section
Audit ignore-file influence
Run without ignore support to compare results.
OpenIn sheetbashsame section
Use trace logging for deeper internals
Emit more verbose debugging than `--debug`.
OpenIn sheetbashsame section
Use dotall semantics with PCRE2
Match a block lazily across newlines.
OpenIn sheetbash2 tag match
Prefer literal search when possible
Use fixed strings for maximum speed.
OpenIn sheetbash1 tag match