Fix perlReToReplacer when \ is used in the replacement

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-03-12 17:17:20 -04:00
parent e00e161a73
commit 58d308b54d

View File

@ -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.