From 58d308b54d9daff3db7fcb9629405fb53bb1501d Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 12 Mar 2009 17:17:20 -0400 Subject: [PATCH] Fix perlReToReplacer when \ is used in the replacement Signed-off-by: James Vega --- src/utils/str.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/str.py b/src/utils/str.py index 8ce149142..0e1af35dd 100644 --- a/src/utils/str.py +++ b/src/utils/str.py @@ -166,8 +166,8 @@ def perlReToReplacer(s): """ sep = _getSep(s) escaped = re.escape(sep) - matcher = re.compile(r's%s((?:\\.|[^\\])*)%s((?:\\%s|[^\\])*)%s(.*)' - % (escaped, escaped, escaped, escaped)) + matcher = re.compile(r's%s((?:\\.|[^\\])*)%s((?:\\.|[^\\])*)%s(.*)' + % (escaped, escaped, escaped)) try: (regexp, replace, flags) = matcher.match(s).groups() except AttributeError: # Unpack list of wrong size.