Am trying to get date sting from filename using regular expression in a python script. Here is my date sting
'2012-09-25 ag.pdf'
To get date string from this filename am using this regex r'\d{4}[-]\d{1,2}[-]\d{1,2}'
and it working fine
but some filenames also contains two digit year and for those am trying another regex r'\d{2}-\d{2}-\d{2}'
'2012-09-25 ag.pdf'
also matches with second regex (r'\d{2}-\d{2}-\d{2}'
) pattern that causing issue with my script
How can i use regex in python to match exact two digits not more than that