Is there a way to split a string without splitting escaped character? For example, I have a string and want to split by \':\' and not by \'\\:\'
http\\://ww
building on @user629923's suggestion, but being much simpler than other answers:
import re DBL_ESC = "!double escape!" s = r"Hello:World\:Goodbye\\:Cruel\\\:World" map(lambda x: x.replace(DBL_ESC, r'\\'), re.split(r'(?