htmldata and python 2.2

Tim Arnold tiarno at
Thu Oct 21 17:48:42 CEST 2004

I'm trying to get (written with Python 2.3 in mind) to work with
Python 2.2.  Thanks much to Paul Clinch for showing me how to convert
for i, text in enumerate(L)
for i, text in zip(range(len(L)),L)

I have one more glitch in getting to work in Python2.2:
Can someone show me how to recode this without the finditer?

L = list(re.finditer(r'url\s*\(([^\r\n\("]*?)\)|' +
                         r'url\s*\(\s*"([^\r\n]*?)"\s*\)', doc))

 The doc says re.finditer is available in 2.2, but I'm guessing it must be
in a minor version update (e.g., 2.2.3). Anyway, I'm getting this error in
the Traceback:

 L = list(re.finditer(r'url\s*\(([^\r\n\("]*?)\)|' +
AttributeError: 'module' object has no attribute 'finditer'

--Tim Arnold

p.s. is public domain code to manipulate
HTML or XHTML documents from Connelly Barnes.

More information about the Python-list mailing list