I have some strings to parse like below, with two delimiters:
import re
str='Beautiful is:better than:ugly'
re.split(' |: ',str)
the output is:
['Beautiful','is','better','than','ugly']
I need to save delimiters in array too, Is there a way to do that like below output?
['Beautiful', ' ', 'is', ':', 'better', ' ', 'than', ':', 'ugly']