I need to use python to extract the date from filenames. The date is in the following format:
month-day-year.somefileextension
Examples:
10-12-2011.zip
somedatabase-10-04-2011.sql.tar.gz
The best way to extract this would be using regular expressions?
I have some code:
import re
m = re.search('(?<=-)\w+', 'derer-10-12-2001.zip')
print m.group(0)
The code will print '10'. Some clue on how to print the date?
Best Regards,