summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-05-08 08:32:20 -0400
committerAndrew Gallant <jamslam@gmail.com>2020-05-08 23:24:40 -0400
commit50840ea43b65dfa7e51b695a7798f6c43808ccc2 (patch)
treef9c0df760825b38ad8403a465143bd78ff57fd8f
parent17dcc2bf51810032f07f060f7a6a43e43d42bb82 (diff)
doc: note how to escape a '$' in --replace
Fixes #1524
-rw-r--r--CHANGELOG.md2
-rw-r--r--crates/core/app.rs2
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e89dff67..9c8c7b3b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@ TBD
===
Bug fixes:
+* [BUG #1524](https://github.com/BurntSushi/ripgrep/issues/1524):
+ Note how to escape a `$` when using `--replace`.
* [BUG #1537](https://github.com/BurntSushi/ripgrep/issues/1537):
Fix match bug caused by inner literal optimization.
* [BUG #1571](https://github.com/BurntSushi/ripgrep/issues/1571):
diff --git a/crates/core/app.rs b/crates/core/app.rs
index 72c37837..39e1057d 100644
--- a/crates/core/app.rs
+++ b/crates/core/app.rs
@@ -2598,6 +2598,8 @@ 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.
+To write a literal '$', use '$$'.
+
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.