Skip to content

Commit

Permalink
doc: improve docs for --replace flag
Browse files Browse the repository at this point in the history
Specifically, we document shell-specific caveats related to the `--replace`
flag.

PR #1318
  • Loading branch information
Calinou authored and BurntSushi committed Jul 4, 2019
1 parent 785c1f1 commit 8ebc113
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,10 @@ Replace every match with the text given when printing results. Neither this
flag nor any other ripgrep flag will modify your files.
Capture group indices (e.g., $5) and names (e.g., $foo) are supported in the
replacement string.
replacement string. In shells such as Bash and zsh, you should wrap the
pattern in single quotes instead of double quotes. Otherwise, capture group
indices will be replaced by expanded shell variables which will most likely
be empty.
Note that the replacement by default replaces each match, and NOT the entire
line. To replace the entire line, you should match the entire line.
Expand Down

0 comments on commit 8ebc113

Please sign in to comment.