> >>>> re.sub(r'\$', '\$', x) > '\\$1\\$asdfjke\\$lkjasdkjfsdasdfj' > > That's why I'm a bit confused. > The double \ is printed by python. If you do s = re.sub() and then print s, it looks just fine. I was confused by this when I tried it out myself.