I have this code:
import re
x = "John Doe, Aug 5 2020 Hello Jane Doe: Aug 5 2020"
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
rx = re.compile(fr"\s+(?=(?:{'|'.join(months)})\b)", re.I)
print(rx.split(x))
Which outputs this:
['John Doe,', 'Aug 5 2020 Hello Jane Doe:', 'Aug 5 2020']
I would like it to output this:
["John Doe, Aug 5 2020", "Hello Jane Doe: Aug 5 2020"]
How could I do this? Thank you in advance for all the help!