@end menu
The @samp{skip-chars@dots{}} functions also perform a kind of searching.
-@xref{Skipping Characters}.
+@xref{Skipping Characters}. To search for changes in character
+properties, see @ref{Property Search}.
@node String Search
@section Searching for Strings
return the new position of point in that case, but some existing
programs may depend on a value of @code{nil}.)
+The argument @var{noerror} only affects valid searches which fail to
+find a match. Invalid arguments cause errors regardless of
+@var{noerror}.
+
If @var{repeat} is supplied (it must be a positive number), then the
search is repeated that many times (each time starting at the end of the
previous time's match). If these successive searches succeed, the
first tries to match all three @samp{a}s; but the rest of the pattern is
@samp{ar} and there is only @samp{r} left to match, so this try fails.
The next alternative is for @samp{a*} to match only two @samp{a}s. With
-this choice, the rest of the regexp matches successfully.@refill
+this choice, the rest of the regexp matches successfully.
-Nested repetition operators take a long time, or even forever, if they
+@strong{Warning:} Nested repetition operators take a long time,
+or even forever, if they
lead to ambiguous matching. For example, trying to match the regular
expression @samp{\(x+y*\)*a} against the string
@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could take hours before it
@samp{x}s before concluding that none of them can work. Even worse,
@samp{\(x*\)*} can match the null string in infinitely many ways, so
it causes an infinite loop. To avoid these problems, check nested
-repetitions carefully.
+repetitions carefully, to make sure that they do not cause combinatorial
+explosions in backtracking.
@item @samp{+}
@cindex @samp{+} in regexp
beginning of the string or after a newline character.
For historical compatibility reasons, @samp{^} can be used only at the
-beginning of the regular expression, or after @samp{\(} or @samp{\|}.
+beginning of the regular expression, or after @samp{\(}, @samp{\(?:}
+or @samp{\|}.
@item @samp{$}
@cindex @samp{$} in regexp
@table @samp
@item [:ascii:]
-This matches any @acronym{ASCII} (unibyte) character.
+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.)
@item [:lower:]
This matches any lower-case letter, as determined by
the current case table (@pxref{Case Tables}).
+@item [:multibyte:]
+This matches any multibyte character (@pxref{Text Representations}).
@item [:nonascii:]
-This matches any non-@acronym{ASCII} (multibyte) character.
+This matches any non-@acronym{ASCII} character.
@item [:print:]
This matches printing characters---everything except @acronym{ASCII} control
characters and the delete character.
@item [:space:]
This matches any character that has whitespace syntax
(@pxref{Syntax Class Table}).
+@item [:unibyte:]
+This matches any unibyte character (@pxref{Text Representations}).
@item [:upper:]
This matches any upper-case letter, as determined by
the current case table (@pxref{Case Tables}).
expressions can have subexpressions---after a simple string search, the
only information available is about the entire match.
+ Every successful search sets the match data. Therefore, you should
+query the match data immediately after searching, before calling any
+other function that might perform another search. Alternatively, you
+may save and restore the match data (@pxref{Saving Match Data}) around
+the call to functions that could perform another search.
+
A search which fails may or may not alter the match data. In the
past, a failing search did not do this, but we may change it in the
future. So don't try to rely on the value of the match data after