diff options
| author | Eli Zaretskii | 2016-07-02 18:03:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-07-02 18:03:09 +0300 |
| commit | 38f4b8ea615025e7996754fd72449be91c38d448 (patch) | |
| tree | ed3d8dddcf974568ed6c5b5fd8cdc99485c93b99 /doc | |
| parent | d039fc4ff628ad7f983707609a6d04a96589895b (diff) | |
| download | emacs-38f4b8ea615025e7996754fd72449be91c38d448.tar.gz emacs-38f4b8ea615025e7996754fd72449be91c38d448.zip | |
Clarify the documentation of back-references in replacements
* doc/emacs/search.texi (Regexp Replace): Clarify that \D starts
with \1, not \0.
* lisp/replace.el (query-replace-regexp)
(query-replace-regexp-eval, replace-regexp): Doc fix (Bug#23884)
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/search.texi | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index d841934c855..b41214df1ae 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1356,12 +1356,12 @@ Replace every match for @var{regexp} with @var{newstring}. | |||
| 1356 | it can refer to all or part of what is matched by the @var{regexp}. | 1356 | it can refer to all or part of what is matched by the @var{regexp}. |
| 1357 | @samp{\&} in @var{newstring} stands for the entire match being | 1357 | @samp{\&} in @var{newstring} stands for the entire match being |
| 1358 | replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a | 1358 | replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a |
| 1359 | digit, stands for whatever matched the @var{d}th parenthesized | 1359 | digit starting from 1, stands for whatever matched the @var{d}th |
| 1360 | grouping in @var{regexp}. (This is called a ``back reference''.) | 1360 | parenthesized grouping in @var{regexp}. (This is called a ``back |
| 1361 | @samp{\#} refers to the count of replacements already made in this | 1361 | reference''.) @samp{\#} refers to the count of replacements already |
| 1362 | command, as a decimal number. In the first replacement, @samp{\#} | 1362 | made in this command, as a decimal number. In the first replacement, |
| 1363 | stands for @samp{0}; in the second, for @samp{1}; and so on. For | 1363 | @samp{\#} stands for @samp{0}; in the second, for @samp{1}; and so on. |
| 1364 | example, | 1364 | For example, |
| 1365 | 1365 | ||
| 1366 | @example | 1366 | @example |
| 1367 | M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} | 1367 | M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} |