use re.sub, not str.replace, otherwise things like "$" dont work
This commit is contained in:
parent
6e9c303fcd
commit
c73570a953
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ class SedReplace(Sed):
|
||||||
for token in reversed(_tokens(replace_copy, "&")):
|
for token in reversed(_tokens(replace_copy, "&")):
|
||||||
replace_copy = (
|
replace_copy = (
|
||||||
replace_copy[:token]+match.group(0)+replace_copy[token+1:])
|
replace_copy[:token]+match.group(0)+replace_copy[token+1:])
|
||||||
s = s.replace(match.group(0), replace_copy, 1)
|
s = re.sub(self.pattern, replace_copy, s, 1)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
|
|
Loading…
Reference in a new issue