[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

Jacques Grove report at bugs.python.org
Fri Oct 29 13:11:34 CEST 2010


Jacques Grove <jacques at tripitinc.com> added the comment:

Do we expect this to work on 64 bit Linux and python 2.6.5?  I've compiled and run some of my code through this, and there seems to be issues with non-greedy quantifier matching (at least relative to the old re module):

$ cat test.py
import re, regex

text = "(MY TEST)"
regexp = '\((?P<test>.{0,5}?TEST)\)'
print re.findall(regexp, text)
print regex.findall(regexp, text)


$ python test.py
['MY TEST']
[]

python 2.7 produces the same results for me.

However, making the quantifier greedy (removing the '?') gives the same result for both re and regex modules.

----------
nosy: +jacques

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________


More information about the Python-bugs-list mailing list