diff options
| author | 2020-02-14 23:57:23 +0000 | |
|---|---|---|
| committer | 2020-02-14 23:57:23 +0000 | |
| commit | c73570a9534fe0d153e1e0dfdda87fbddd1ba96d (patch) | |
| tree | 97a89c332a8607dfdae3a0bc5ad7d0bafe21ae45 /src | |
| parent | update coins.py to use command specs (and not docstrings) (diff) | |
| signature | ||
use re.sub, not str.replace, otherwise things like "$" dont work
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/parse/sed.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/parse/sed.py b/src/utils/parse/sed.py index 3c2180b2..75d24be4 100644 --- a/src/utils/parse/sed.py +++ b/src/utils/parse/sed.py @@ -35,7 +35,7 @@ class SedReplace(Sed): for token in reversed(_tokens(replace_copy, "&")): replace_copy = ( 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 @dataclasses.dataclass |
