[New-bugs-announce] [issue1946] re.search hangs on this

Israel Tsadok report at bugs.python.org
Sun Jan 27 16:59:04 CET 2008


New submission from Israel Tsadok:

import re
re.search(r'a(b[^b]*b|[^c])*cxxx',
'abbcacabbbbcabbbbbbcabbbbbbbbbbbbbbcacabbbbbbbbbbbbbbcabbbbcac')

perl seems to handle this just fine.

(The original problem was trying to translate some html to text:
re.sub(r'<p(?:"[^"]*"|[^>])*>(.*?)</p>', r'\1\n')

This hanged on several files. Changing [^>] to [^">] resolved my
problem, but the general case remains.)

This might be a dupe of http://bugs.python.org/issue1297193

----------
components: Regular Expressions
messages: 61739
nosy: itsadok
severity: normal
status: open
title: re.search hangs on this
versions: Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1946>
__________________________________


More information about the New-bugs-announce mailing list