diff options
author | Karl Berry <karl@gnu.org> | 2007-04-11 16:27:33 +0000 |
---|---|---|
committer | Karl Berry <karl@gnu.org> | 2007-04-11 16:27:33 +0000 |
commit | cd64b8f1e1b6902b9e0b65852b2bf46517400bbb (patch) | |
tree | 6cd1ab2de513a8d1c758295a4f3002a379d0b656 /lispref/searching.texi | |
parent | db365b8e568d08803c34ea0b88a984644e425745 (diff) | |
download | emacs-cd64b8f1e1b6902b9e0b65852b2bf46517400bbb.tar.gz |
improve breaks in 8.5x11
Diffstat (limited to 'lispref/searching.texi')
-rw-r--r-- | lispref/searching.texi | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lispref/searching.texi b/lispref/searching.texi index 056e1bd51a5..10e8c672962 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi @@ -309,17 +309,16 @@ first tries to match all three @samp{a}s; but the rest of the pattern is The next alternative is for @samp{a*} to match only two @samp{a}s. With this choice, the rest of the regexp matches successfully. -@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 -ultimately fails. Emacs must try each way of grouping the 35 -@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, to make sure that they do not cause combinatorial -explosions in backtracking. +@strong{Warning:} Nested repetition operators can run for an +indefinitely long time, if they lead to ambiguous matching. For +example, trying to match the regular expression @samp{\(x+y*\)*a} +against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could +take hours before it ultimately fails. Emacs must try each way of +grouping the @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, to make sure that they do not +cause combinatorial explosions in backtracking. @item @samp{+} @cindex @samp{+} in regexp |