]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/searching.texi
Merge from origin/emacs-24
[gnu-emacs] / doc / lispref / searching.texi
index 2f287cc97056d298ae62f4ec7cbe527d32b22396..87513e8f9ce252bc2effd5ef03694f7c4345eb72 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-1999, 2001-2014 Free Software
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Searching and Matching
@@ -257,6 +257,8 @@ it easier to verify even very complex regexps.
 
 @node Syntax of Regexps
 @subsection Syntax of Regular Expressions
+@cindex regexp syntax
+@cindex syntax of regular expressions
 
   Regular expressions have a syntax in which a few characters are
 special constructs and the rest are @dfn{ordinary}.  An ordinary
@@ -294,6 +296,7 @@ need to use one of the special regular expression constructs.
 
 @node Regexp Special
 @subsubsection Special Characters in Regular Expressions
+@cindex regexp, special characters in
 
   Here is a list of the characters that are special in a regular
 expression.
@@ -538,11 +541,15 @@ and what they mean:
 @item [:ascii:]
 This matches any @acronym{ASCII} character (codes 0--127).
 @item [:alnum:]
-This matches any letter or digit.  (At present, for multibyte
-characters, it matches anything that has word syntax.)
+This matches any letter or digit.  For multibyte characters, it
+matches characters whose Unicode @samp{general-category} property
+(@pxref{Character Properties}) indicates they are alphabetic or
+decimal number characters.
 @item [:alpha:]
-This matches any letter.  (At present, for multibyte characters, it
-matches anything that has word syntax.)
+This matches any letter.  For multibyte characters, it matches
+characters whose Unicode @samp{general-category} property
+(@pxref{Character Properties}) indicates they are alphabetic
+characters.
 @item [:blank:]
 This matches space and tab only.
 @item [:cntrl:]
@@ -894,6 +901,7 @@ beyond the minimum needed to end a sentence.
 
   These functions operate on regular expressions.
 
+@cindex quote special characters in regexp
 @defun regexp-quote string
 This function returns a regular expression whose only exact match is
 @var{string}.  Using this regular expression in @code{looking-at} will
@@ -924,6 +932,7 @@ whitespace:
 @end example
 @end defun
 
+@cindex optimize regexp
 @defun regexp-opt strings &optional paren
 This function returns an efficient regular expression that will match
 any of the strings in the list @var{strings}.  This is useful when you
@@ -983,10 +992,11 @@ list of characters @var{chars}.
 @cindex searching for regexp
 
   In GNU Emacs, you can search for the next match for a regular
-expression either incrementally or not.  For incremental search
-commands, see @ref{Regexp Search, , Regular Expression Search, emacs,
-The GNU Emacs Manual}.  Here we describe only the search functions
-useful in programs.  The principal one is @code{re-search-forward}.
+expression (@pxref{Syntax of Regexps}) either incrementally or not.
+For incremental search commands, see @ref{Regexp Search, , Regular
+Expression Search, emacs, The GNU Emacs Manual}.  Here we describe
+only the search functions useful in programs.  The principal one is
+@code{re-search-forward}.
 
   These search functions convert the regular expression to multibyte if
 the buffer is multibyte; they convert the regular expression to unibyte
@@ -1284,7 +1294,7 @@ If you did the last search in a buffer, you should omit the
 the current buffer is the one in which you performed the last search.
 Then this function edits the buffer, replacing the matched text with
 @var{replacement}.  It leaves point at the end of the replacement
-text, and returns @code{t}.
+text.
 
 If you performed the last search on a string, pass the same string as
 @var{string}.  Then this function returns a new string, in which the