problems with re
Marc Risney
marc.risney at oracle.com
Wed May 30 23:48:27 EDT 2001
using the urllib and formatting the resulting html, I seem to be getting an
error.
here's the rouge function
def scrubhtml(self):
x = 0
for entry in self.entries:
tempstring = re.search(r'<h3>Search
Results</h3>(.*?)</table>',entry,re.DOTALL)
if tempstring: entry = tempstring.group(1) + "</table>"
scrubbed_entry = string.replace(entry, "\n", "")
self.entries[x] = scrubbed_entry
x += 1
I'm getting the following error:
Traceback (most recent call last):
File "D:\py_libs\wip\chs\chs.py", line 115, in ?
Run()
File "D:\py_libs\wip\chs\chs.py", line 101, in Run
g.scrubhtml()
File "D:\py_libs\wip\chs\chs.py", line 71, in scrubhtml
tempstring = re.search(r'<h3>Search
Results</h3>(.*?)</table>',entry,re.DOTA
LL)
File "d:\python21\lib\sre.py", line 57, in search
return _compile(pattern, flags).search(string)
RuntimeError: maximum recursion limit exceeded
any ideas??
More information about the Python-list
mailing list