My previous example was not clear, I give another example :
a = '123 - 48 <!-- 456 - 251 - --> 452 - 348'
And if i do something like :
[el for el in re.split(r' - ',a)]
I catch :
['123', '48 <!-- 456', '251', '--> 452', '348']
But I want this :
['123', '48 <!-- 456 - 251 - --> 452', '348']
Thanks...
filterone of the fastest solutions, especially for longer text. (Don't forget to pick an answer.)