emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/man/search.texi


From: Luc Teirlinck
Subject: [Emacs-diffs] Changes to emacs/man/search.texi
Date: Thu, 09 Mar 2006 02:03:20 +0000

Index: emacs/man/search.texi
diff -u emacs/man/search.texi:1.72 emacs/man/search.texi:1.73
--- emacs/man/search.texi:1.72  Wed Feb  8 00:15:47 2006
+++ emacs/man/search.texi       Thu Mar  9 02:03:20 2006
@@ -498,11 +498,13 @@
 special constructs and the rest are @dfn{ordinary}.  An ordinary
 character is a simple regular expression which matches that same
 character and nothing else.  The special characters are @samp{$},
address@hidden, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, @samp{]} and
address@hidden  Any other character appearing in a regular expression is
-ordinary, unless a @samp{\} precedes it.  (When you use regular
-expressions in a Lisp program, each @samp{\} must be doubled, see the
-example near the end of this section.)
address@hidden, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and
address@hidden  The character @samp{]} is special if it ends a character
+alternative (see later).  The character @samp{-} is special inside a
+character alternative.  Any other character appearing in a regular
+expression is ordinary, unless a @samp{\} precedes it.  (When you use
+regular expressions in a Lisp program, each @samp{\} must be doubled,
+see the example near the end of this section.)
 
   For example, @samp{f} is not a special character, so it is ordinary, and
 therefore @samp{f} is a regular expression that matches the string
@@ -682,6 +684,14 @@
 to depend on this behavior; it is better to quote the special character anyway,
 regardless of where it appears.
 
+As a @samp{\} is not special inside a character alternative, it can
+never remove the special meaning of @samp{-} or @samp{]}.  So you
+should not quote these characters when they have no special meaning
+either.  This would not clarify anything, since backslashes can
+legitimately precede these characters where they @emph{have} special
+meaning, as in @code{[^\]} (@code{"[^\\]"} for Lisp string syntax),
+which matches any single character except a backslash.
+
 @node Regexp Backslash
 @section Backslash in Regular Expressions
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]