regexp upward compatibility bug ?

Gilles Lenfant glenfant at
Thu Jan 29 16:06:55 CET 2004


Porting a Zope app from (old) Zope 2.3.3 powered by Python 1.5.2 to a 
newer Zope powered by Python 2.1.3, I found a regexp problem :

This does perfectly the job with Python 1.5.2 but raises an exception 
with Python 2.1.3. I can't see what's wrong when reading the "re" module 

Any hint welcome

   File "", line 27, in txt2html
     pat = re.compile(r'((ftp|http)://[\w-]+(?:\.[\w-]+)*(?:/[\w-\.?=]*)*)')
   File "/usr/local/lib/python2.1/", line 90, in compile
     return _compile(pattern, flags)
   File "/usr/local/lib/python2.1/", line 136, in _compile
     raise error, v # invalid expression
sre_constants.error: bad character range

Many thanks by advance


More information about the Python-list mailing list