aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-04-12 13:40:23 +0000
committerEli Zaretskii2006-04-12 13:40:23 +0000
commit0d8b7acbb3dd5af4b7cb7174920ca510a9c4eeac (patch)
treec655d323a01bf7820060c0fa0367f571840ab21a
parent483b913a7bd9ef09352c9527d3f1290fcbdee84e (diff)
downloademacs-0d8b7acbb3dd5af4b7cb7174920ca510a9c4eeac.tar.gz
emacs-0d8b7acbb3dd5af4b7cb7174920ca510a9c4eeac.zip
(Regexp Backslash, Regexp Replace): Add index entries for ``back reference''
and mention the term itself in the text.
-rw-r--r--man/ChangeLog6
-rw-r--r--man/search.texi12
2 files changed, 13 insertions, 5 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index e084c379762..c99c487ee3c 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,9 @@
12006-04-12 Eli Zaretskii <eliz@gnu.org>
2
3 * search.texi (Regexp Backslash, Regexp Replace): Add index
4 entries for ``back reference'' and mention the term itself in the
5 text.
6
12006-04-11 Richard Stallman <rms@gnu.org> 72006-04-11 Richard Stallman <rms@gnu.org>
2 8
3 * custom.texi (Safe File Variables): 9 * custom.texi (Safe File Variables):
diff --git a/man/search.texi b/man/search.texi
index a38f56e3f26..ab109445091 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -750,8 +750,9 @@ can add groups for syntactic purposes without interfering with
750the numbering of the groups that are meant to be referred to. 750the numbering of the groups that are meant to be referred to.
751 751
752@item \@var{d} 752@item \@var{d}
753@cindex back reference, in regexp
753matches the same text that matched the @var{d}th occurrence of a 754matches the same text that matched the @var{d}th occurrence of a
754@samp{\( @dots{} \)} construct. 755@samp{\( @dots{} \)} construct (a.k.a.@: @dfn{back reference}).
755 756
756After the end of a @samp{\( @dots{} \)} construct, the matcher remembers 757After the end of a @samp{\( @dots{} \)} construct, the matcher remembers
757the beginning and end of the text matched by that construct. Then, 758the beginning and end of the text matched by that construct. Then,
@@ -1002,15 +1003,16 @@ any match for a specified pattern.
1002Replace every match for @var{regexp} with @var{newstring}. 1003Replace every match for @var{regexp} with @var{newstring}.
1003@end table 1004@end table
1004 1005
1006@cindex back reference, in regexp replacement
1005 In @code{replace-regexp}, the @var{newstring} need not be constant: 1007 In @code{replace-regexp}, the @var{newstring} need not be constant:
1006it can refer to all or part of what is matched by the @var{regexp}. 1008it can refer to all or part of what is matched by the @var{regexp}.
1007@samp{\&} in @var{newstring} stands for the entire match being 1009@samp{\&} in @var{newstring} stands for the entire match being
1008replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a 1010replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a
1009digit, stands for whatever matched the @var{d}th parenthesized 1011digit, stands for whatever matched the @var{d}th parenthesized
1010grouping in @var{regexp}. @samp{\#} refers to the count of 1012grouping in @var{regexp} (a.k.a.@: ``back reference''). @samp{\#}
1011replacements already made in this command, as a decimal number. In 1013refers to the count of replacements already made in this command, as a
1012the first replacement, @samp{\#} stands for @samp{0}; in the second, 1014decimal number. In the first replacement, @samp{\#} stands for
1013for @samp{1}; and so on. For example, 1015@samp{0}; in the second, for @samp{1}; and so on. For example,
1014 1016
1015@example 1017@example
1016M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} 1018M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}