I would like to split the string into characters: and. However, I would like to ignore the two spaces '' and the two colons '::'. eg,
text = "s:11011 i:11010 ::110011 :110010 d:11000"
should be divided into
[s,11011,i,11010,:,110011, ,110010,d,11000]
after executing the HOWTO regular expressions on the python website, I managed to find the following
regx= re.compile('([\s:]|[^\s\s]|[^::])')
regx.split(text)
However, this does not work as intended, as it breaks into: and spaces, but it still has a ":" and "".
[s,:,11011, ,i,:,11010, ,:,:,110011, , :,110010, ,d,:,11000]
How can i fix this?
EDIT: In case of double space, I only need one place to display