Let's say I have a program which has inputs like this
string28something8words2000
I want to fetch that date embedded it the string so I can get:
day = 28
month = 8
year = 2000
How can I implement this using regular expressions?
The month 8 can not be explicitly a number but also written as "august".
This is not the case of the marked as duplicate which has no optionals.
If I get a list containing:
string28somethingaugustwords2000
With that solution I get only [28, 2000]
and if the number is equal or minor to 12 there is no way to know if it was a month or a day.