# HG changeset patch # User Richard M. Stallman # Date 799386449 0 # Node ID f43818d3bbd810ca0603adb3459cc9830f408bcb # Parent 38f3ac2845f7f10b860a1b7a77a488b892315707 Warn about nested repetition. diff -r 38f3ac2845f7 -r f43818d3bbd8 lispref/searching.texi --- a/lispref/searching.texi Tue May 02 02:18:34 1995 +0000 +++ b/lispref/searching.texi Tue May 02 03:47:29 1995 +0000 @@ -225,6 +225,14 @@ 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 +Nested repetition operators can be extremely slow if they specify +backtracking loops. For example, @samp{\(x+y*\)*a} could take hours to +match the sequence @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}. The +slowness is because Emacs must try each imaginable way of grouping the +35 @samp{x}'s before concluding that none of them can work. To make +sure your regular expressions run fast, check nested repetitions +carefully. + @item + @cindex @samp{+} in regexp is a suffix operator similar to @samp{*} except that the preceding