I would like to write a regex in Python to pull out '28 june 1994' from the string below and convert june to 6:
fur = "missed intake office visit on 28 june 1994 at sierra vista nursing homesuicidal behavior hx of suicidal be"
I have tried:
fur.extract(r'(?P<day>\d?\d)\s(?P<month>\W+)\s(?P<year>\d+)')
june can take multiple forms including: 'jun', 'june', 'june,' 'june;' ect.
\W+will match all non-words characters, I'm sure you meant\w+?. Also you want to replace onlyjuneor other months too?