mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-25 07:28:20 +00:00
Warn about nested repetition.
This commit is contained in:
parent
698e4c1c47
commit
7303160369
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user