Regular expression fun. Repeated matching of a group Q

johnzenger at gmail.com johnzenger at gmail.com
Fri Feb 24 10:55:29 EST 2006


There's more to re than just sub.  How about:

sanesplit = re.split(r"</td><td>|<td>|</td>", text)
date = sanesplit[1]
times = times = [time for time in sanesplit if re.match("\d\d:\d\d",
time)]

... then "date" contains the date at the beginning of the line and
"times" contains all your times.




More information about the Python-list mailing list