Regular Expressions
Jens Thiede
jens.news at webgear.co.za
Sat Aug 14 11:47:09 EDT 2004
What is the easiest way to generate a list that contains all the
remnants of re.findall (the inverse of the following).
>>> file = open("index.html", "r")
>>> data = file.read()
>>> patern = re.compile("<title>(.*)</title>", re.S | re.I)
>>> patern.findall(data)
['Damn Small Expansions!']
>>> file.close()
re.split doesn't seem to work quite well, but then, I'm probably using
it wrong.
Any suggestions?
Jens.
More information about the Python-list
mailing list