How do I escape a backslash and a single quote or double quote in Python?
For example:
Long string = \'\'\'some \'long\' string \\\' and \\\" some \'
is this what you want?
import re Long_string = "some long string \' and \" some escaped strings" value_to_change = re.compile( "'|\"" ) modified = re.sub(value_to_change , 'thevalue' , Long_string ) print modified