[Solved] How to replace 4 backslashes


You don’t need a regex, look for the apostrophe following the backslashes and replace the whole pattern with just an apostrophe:

In [1]: s = "It was quick and great ! And it\\\\'s customized"

In [2]: s.replace(r"\\'", "'")
Out[2]: "It was quick and great ! And it's customized"

Based on your repr output you don’t have multiple backslashes you have 2:

Out[4]: u"It was quick and great ! And it\\'s customized"

In [5]: s.replace(r"\'","'")
Out[5]: u"It was quick and great ! And it's customized"

11

solved How to replace 4 backslashes