Don't unicode_escape the argument if using regex mode.

This was causing issues with backslashes.
This commit is contained in:
voussoir 2020-11-15 17:58:26 -08:00
parent e2a8f95b01
commit 3c061f8daa

View file

@ -54,6 +54,9 @@ def contentreplace_argparse(args):
replace_to = pyperclip.paste() replace_to = pyperclip.paste()
else: else:
replace_from = codecs.decode(args.replace_from, 'unicode_escape') replace_from = codecs.decode(args.replace_from, 'unicode_escape')
if args.do_regex:
replace_to = args.replace_to
else:
replace_to = codecs.decode(args.replace_to, 'unicode_escape') replace_to = codecs.decode(args.replace_to, 'unicode_escape')
for filename in filenames: for filename in filenames: