I have a string like this:
string = 'attachment; filename="This-is-my-file-2019-10-01.csv"'
I want to only extract date information "2019-10-01" (the same format)
I used:
re.match('^[ 0-9]+$', string)
and
re.match(r'^([\s\d]+)$', string)
and
re.findall(r'\d', string)
Yet the first two can't even get any digit..I wonder why.. and the the output for the last one is ['2', '0', '1', '9', '1', '0', '0', '1']. I wonder if there's any way that the date information can be extracted directly? Thank you!