RE bug in Python 2.0b1

vio vmilitaru at sympatico.ca
Fri Sep 15 05:31:44 CEST 2000


I believe there may be a RE bug in 2.0b1. Consider the following script:

#!/usr/bin/env python
import re
s = "red green blue"
m = re.compile(r'green (\w+)', re.IGNORECASE)
t = re.subn(m, r'matchedword \1 blah', s)
print t


When I run this on 1.5.2, I get the following expected output:

('red matchedword blue blah', 1)


If I run it on 2.0b1, python basically hangs.


Vio

PS. Thanks to Mike Fletcher <mfletch at tpresence.com> and Opinderjit
<bhellao at my-deja.com> for their help.





More information about the Python-list mailing list