You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using ripgrep's --replace option, '$' can't be used in the replacement text, because it is interpreted as the name of a capture group and cannot be escaped: rg -iIN 'test([^:_$])' -r '$replacement_text$$1' outputs $1 instead of e.g. $replacement_text$!
Trying to escape the '$' does not work either: rg -iIN 'test([^:_$])' -r '\$replacement_text\$$1' yields \\$1 instead.
The text was updated successfully, but these errors were encountered:
What version of ripgrep are you using?
ripgrep 12.0.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
What operating system are you using ripgrep on?
Windows 10
Describe your question, feature request, or bug.
When using ripgrep's --replace option, '$' can't be used in the replacement text, because it is interpreted as the name of a capture group and cannot be escaped:
rg -iIN 'test([^:_$])' -r '$replacement_text$$1'
outputs$1
instead of e.g.$replacement_text$!
Trying to escape the '$' does not work either:
rg -iIN 'test([^:_$])' -r '\$replacement_text\$$1'
yields\\$1
instead.The text was updated successfully, but these errors were encountered: