fork download
  1. import re
  2. months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
  3. s = 'Aug 5 2020: John Doe: Hello Aug 5 2020 Jane Doe: Hi'
  4. rx = re.compile( fr"\s+(?=(?:{'|'.join(months)})\b)", re.I )
  5. print (rx)
  6. print (rx.split(s))
Success #stdin #stdout 0.02s 9376KB
stdin
Standard input is empty
stdout
re.compile('\\s+(?=(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\b)', re.IGNORECASE)
['Aug 5 2020: John Doe: Hello', 'Aug 5 2020 Jane Doe: Hi']