python check if string matches date format