mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-01-24 13:56:47 +02:00
parent
a6a24bafb3
commit
2143bcf9cb
11
doc/rg.1
11
doc/rg.1
@ -340,6 +340,17 @@ Neither this flag nor any other flag will modify your files.
|
|||||||
.PP
|
.PP
|
||||||
Capture group indices (e.g., $5) and names (e.g., $foo) are supported in
|
Capture group indices (e.g., $5) and names (e.g., $foo) are supported in
|
||||||
the replacement string.
|
the replacement string.
|
||||||
|
.PP
|
||||||
|
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.
|
||||||
|
For example, to emit only the first phone numbers in each line:
|
||||||
|
.IP
|
||||||
|
.nf
|
||||||
|
\f[C]
|
||||||
|
rg\ \[aq]^.*([0\-9]{3}\-[0\-9]{3}\-[0\-9]{4}).*$\[aq]\ \-\-replace\ \[aq]$1\[aq]
|
||||||
|
\f[]
|
||||||
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-s, \-\-case\-sensitive
|
.B \-s, \-\-case\-sensitive
|
||||||
|
@ -231,6 +231,12 @@ Project home page: https://github.com/BurntSushi/ripgrep
|
|||||||
Capture group indices (e.g., $5) and names (e.g., $foo) are supported
|
Capture group indices (e.g., $5) and names (e.g., $foo) are supported
|
||||||
in the replacement string.
|
in the replacement string.
|
||||||
|
|
||||||
|
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.
|
||||||
|
For example, to emit only the first phone numbers in each line:
|
||||||
|
|
||||||
|
rg '^.*([0-9]{3}-[0-9]{3}-[0-9]{4}).*$' --replace '$1'
|
||||||
|
|
||||||
-s, --case-sensitive
|
-s, --case-sensitive
|
||||||
: Search case sensitively. This overrides --ignore-case and --smart-case.
|
: Search case sensitively. This overrides --ignore-case and --smart-case.
|
||||||
|
|
||||||
|
@ -417,7 +417,10 @@ lazy_static! {
|
|||||||
"Replace every match with the string given when printing \
|
"Replace every match with the string given when printing \
|
||||||
results. Neither this flag nor any other flag will modify your \
|
results. Neither this flag nor any other flag will modify your \
|
||||||
files.\n\nCapture group indices (e.g., $5) and names \
|
files.\n\nCapture group indices (e.g., $5) and names \
|
||||||
(e.g., $foo) are supported in the replacement string.");
|
(e.g., $foo) are supported in the replacement string.\n\n\
|
||||||
|
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.");
|
||||||
doc!(h, "case-sensitive",
|
doc!(h, "case-sensitive",
|
||||||
"Search case sensitively.",
|
"Search case sensitively.",
|
||||||
"Search case sensitively. This overrides -i/--ignore-case and \
|
"Search case sensitively. This overrides -i/--ignore-case and \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user