[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lispref/searching.texi [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lispref/searching.texi [emacs-unicode-2] |
Date: |
Mon, 28 Jun 2004 04:33:13 -0400 |
Index: emacs/lispref/searching.texi
diff -c emacs/lispref/searching.texi:1.44.2.1
emacs/lispref/searching.texi:1.44.2.2
*** emacs/lispref/searching.texi:1.44.2.1 Mon Apr 19 07:01:43 2004
--- emacs/lispref/searching.texi Mon Jun 28 07:28:59 2004
***************
*** 244,256 ****
The next alternative is for @samp{a*} to match only two @samp{a}s. With
this choice, the rest of the regexp matches address@hidden
! Nested repetition operators can be extremely slow if they specify
! backtracking loops. For example, it could take hours for the regular
! expression @samp{\(x+y*\)*a} to try to match the sequence
! @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately fails.
! 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 @samp{+}
--- 244,258 ----
The next alternative is for @samp{a*} to match only two @samp{a}s. With
this choice, the rest of the regexp matches address@hidden
! Nested repetition operators can be extremely slow or loop infinitely
! if they use repetition operators inside repetition operators. For
! example, it could take hours for the regular expression
! @samp{\(x+y*\)*a} to try to match the sequence
! @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, 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.
@item @samp{+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lispref/searching.texi [emacs-unicode-2],
Miles Bader <=