Would like to add a space in between different characters. The one I have now adds it in-between every character, whereas I would like to omit that if the characters are the same (consecutive).
import re
string = "CEEEETTEEEEGGGCCBCTTBHHHHHCCEEEEEEEEETTEETT"
space = re.compile(r"(?<!^)(?=[CEHBGITS])(?!$)")
print(space.sub("\1", string))
Expected result is: C EEEE TT EEEE GGG CC B C TT B HHHHH CC EEEEEEEEE TT EE TT