handle meta_name__unit as used in regexp groups names

parent 361e636e
...@@ -35,7 +35,7 @@ def renamesSearchRe(renames): ...@@ -35,7 +35,7 @@ def renamesSearchRe(renames):
else: else:
first = False first = False
res.write(k) res.write(k)
res.write(r")\b") res.write(r")(__|\b)")
renameReStr = res.getvalue() renameReStr = res.getvalue()
return re.compile(renameReStr) return re.compile(renameReStr)
...@@ -59,6 +59,8 @@ def replaceInFile(filePath, replacements): ...@@ -59,6 +59,8 @@ def replaceInFile(filePath, replacements):
didReplace[old] = didReplace.get(old, []) + [lineNr] didReplace[old] = didReplace.get(old, []) + [lineNr]
outF.write(line[ii:m.start()]) outF.write(line[ii:m.start()])
outF.write(replacements[old]) outF.write(replacements[old])
if m.group(2):
outF.write(m.group(2))
ii = m.end() ii = m.end()
outF.write(line[ii:]) outF.write(line[ii:])
if didReplace: if didReplace:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment