Python

Python Regex Partial Replace

August 9, 2017 ∙ Use capture group and reference: re.sub(r”(match)(replace)“, r”\1new”, string)