[Zope-dev] random regex

seb bacon seb@jamkit.com
Wed, 26 Sep 2001 15:47:26 +0100


I'm finding that the regex which deals with links in structured text
is broken (Zope 2.4.1, Python 2.1).  If you try a link with a query
string:
 
 "link":http://www.foo.com?ding=dong&bit=bat

the part of the regex which is matching the url only matches up to the
first '=' (or '&').

If I run the expression against a string in the python interpreter,
the correct match is returned.  The problem only occurs in
lib/python/StructuredText/DocumentClass.py.  After a lot of playing
around with the expression, I found I could only get it to match
correctly *by running it against the same string three times in a
row*. 

Can anyone else reproduce this problem?  Has anyone any suggestions as
to what might be causing it?  Perhaps it's some kind of boundary
condition in the re module?  I don't really have the time to pursue it
much further, so it looks like I'll have to settle with a Tracker
entry and a nasty hack.

seb