diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-05-02 03:47:29 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-05-02 03:47:29 +0000 |
commit | f360b914c9cf82094bde176bc5b8a6f03968b17f (patch) | |
tree | 3f1047e750595afebc7716739a871da78e680b96 /lispref | |
parent | ade6e4fc33e89c89e35e4c0f3cdb76f725998f0b (diff) | |
download | emacs-f360b914c9cf82094bde176bc5b8a6f03968b17f.tar.gz |
Warn about nested repetition.
Diffstat (limited to 'lispref')
-rw-r--r-- | lispref/searching.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lispref/searching.texi b/lispref/searching.texi index 0de6b907771..ec082152aad 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi @@ -225,6 +225,14 @@ 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.@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 |