fork download
  1. import re
  2. my_str = '610640: 168 hours 610835: till next day 14:00 617041: 168 hours 611486:720 hours'
  3. match = re.split(r'\s+(?=\d{6}:)', my_str)
  4. print(match)
  5. for item in match:
  6. print(item)
Success #stdin #stdout 0.03s 9508KB
stdin
Standard input is empty
stdout
['610640: 168 hours', '610835: till next day 14:00', '617041:  168 hours', '611486:720 hours']
610640: 168 hours
610835: till next day 14:00
617041:  168 hours
611486:720 hours