]> code.delx.au - gnu-emacs/commitdiff
(Regexps): Explain that ^ and $ have their
authorRichard M. Stallman <rms@gnu.org>
Thu, 4 Mar 2004 17:25:34 +0000 (17:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 4 Mar 2004 17:25:34 +0000 (17:25 +0000)
special meanings only in certain contexts.

man/search.texi

index ef2d577623255c4ad288d2422f17331fc89cdd5d..303074dcf0d397eab744cf0c8cc335807c53225e 100644 (file)
@@ -576,10 +576,18 @@ beginning of a line in the text being matched.  Otherwise it fails to
 match anything.  Thus, @samp{^foo} matches a @samp{foo} that occurs at
 the beginning of a line.
 
+For historical compatibility reasons, @samp{^} can be used with this
+meaning only at the beginning of the regular expression, or after
+@samp{\(} or @samp{\|}.
+
 @item @kbd{$}
 is similar to @samp{^} but matches only at the end of a line.  Thus,
 @samp{x+$} matches a string of one @samp{x} or more at the end of a line.
 
+For historical compatibility reasons, @samp{$} can be used with this
+meaning only at the end of the regular expression, or before @samp{\)}
+or @samp{\|}.
+
 @item @kbd{\}
 has two functions: it quotes the special characters (including
 @samp{\}), and it introduces additional special constructs.