bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34823: 27.0.50; re-search-forward infloop


From: Mattias Engdegård
Subject: bug#34823: 27.0.50; re-search-forward infloop
Date: Fri, 29 Mar 2019 14:28:18 +0100

It is not actually an infinite loop; it just takes a very long time.

Your case is, more or less, essentially

(search-string "\\(?:a*\\)*b" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")

Try trimming the string, and you will see that the match does terminate (and 
fail); it is just super-linear in the length of the text.
This is a shortcoming of the general type of regexp engine used by Emacs.

To work around your problem, you should make the regexp less prone to 
backtracking. Try asking on the list help-gnu-emacs@gnu.org for advice. 
Describe what text you wish to match as precisely as possible.






reply via email to

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