Regression? Neverending regexp when upgrading to latest version.

Create issue
Issue #190 resolved
David Novakovic created an issue

After upgrading regex we've noticed some of our servers getting into infinite loops. This probably would have happened with the built in re library too, which is why we were using regex.

When using pip install regex==2015.5.10 the below issue does not happen. With regex==2016.02.25 the below happens. I've attached t.txt for reference. Please let me know if there's anything else I can provide to help with this.

Thanks for the lib... it has been an amazing find for us! :)

>>> pattern
'(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\'".,<>?\xc2\xab\xc2\xbb\xe2\x80\x9c\xe2\x80\x9d\xe2\x80\x98\xe2\x80\x99]))'
>>> import regex
>>> s = open("t.txt").read()
>>> regex.findall(pattern, s)
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dpn/.virtualenvs/content-processor/lib/python2.7/site-packages/regex.py", line 333, in findall
    overlapped, concurrent)
KeyboardInterrupt
>>> 

Comments (2)

  1. Log in to comment