import rerex = r"\s+(?=\d{2}(?:\d{2})?-\d{1,2}-\d{1,2}\b)"s = "2018-03-14 06:08:18, he went on 2018-03-15 06:08:18, lets play"print(re.split(rex, s))
Standard input is empty
['2018-03-14 06:08:18, he went on', '2018-03-15 06:08:18, lets play']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!