新しい文字列 = 文字列.replace("旧", "新")
import re新しい文字列 = re.sub(r"正規表現", "新", 文字列)
import reregex = re.compile(r"正規表現")regex.sub("新", 文字列)
r"\1_abc"