if I have a string such as '<td>01/12/2011</td>' and i want
to reformat it as '20110112', how do i pull out the components
of the string and reformat them into a YYYYDDMM format?

I have:

import re

test = re.compile('\d\d\/')
f = open('test.html')  # This file contains the html dates
for line in f:
    if test.search(line):
        # I need to pull the date components here
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to