__peter__ at web.de
Tue May 16 17:44:06 CEST 2006
Lance Hoffmeyer wrote:
> I have the following table and I am trying to match percentage the 2nd
> column on the 2nd Tiger line (9.0).
> I have tried both of the following. I expected both to match but neither
> did? Is there a modifier
> I am missing? What changes do I need to make these match? I need to keep
> the structure of the regex the same.
You can try the re.DOTALL flag (prepend the regex string with "(?s)"), but
I'd go with something really simple:
instream = iter(target_table.splitlines()) # or: instream = open(datafile)
for line in instream:
value = instream.next().split() # or ...? they are both '9.0'
More information about the Python-list