emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispref/searching.texi


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lispref/searching.texi
Date: Sat, 18 Jun 2005 09:56:17 -0400

Index: emacs/lispref/searching.texi
diff -c emacs/lispref/searching.texi:1.60 emacs/lispref/searching.texi:1.61
*** emacs/lispref/searching.texi:1.60   Wed Jun 15 15:19:41 2005
--- emacs/lispref/searching.texi        Sat Jun 18 13:56:16 2005
***************
*** 244,259 ****
  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{+}
  @cindex @samp{+} in regexp
--- 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 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.
  
  @item @samp{+}
  @cindex @samp{+} in regexp
***************
*** 347,355 ****
  
  @item @samp{[^ @dots{} ]}
  @cindex @samp{^} in regexp
! @samp{[^} begins a @dfn{complemented character alternative}, which matches any
! character except the ones specified.  Thus, @samp{[^a-z0-9A-Z]} matches
! all characters @emph{except} letters and digits.
  
  @samp{^} is not special in a character alternative unless it is the first
  character.  The character following the @samp{^} is treated as if it
--- 346,355 ----
  
  @item @samp{[^ @dots{} ]}
  @cindex @samp{^} in regexp
! @samp{[^} begins a @dfn{complemented character alternative}.  This
! matches any character except the ones specified.  Thus,
! @samp{[^a-z0-9A-Z]} matches all characters @emph{except} letters and
! digits.
  
  @samp{^} is not special in a character alternative unless it is the first
  character.  The character following the @samp{^} is treated as if it




reply via email to

[Prev in Thread] Current Thread [Next in Thread]