Show how a replacement would look without editing files.
Section: Formatting and location metadata
Preview replacements in output
bash
bash
rg -N --replace '$1_id' '([a-z]+)Id' src/Explanation
ripgrep does not rewrite files, but `--replace` is excellent for previewing transformations.
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 Formatting and location metadata
Disable file headings
Print file names inline per match instead of grouped headings.
Print only the matched text
Return the matched substring instead of the full line.
Print summary statistics
Show counts and timing information at the end of a search.