datetime.datetime.now()
Format string, join list or append string.
Use re.search
Use capture group and reference: re.sub(r"(match)(replace)", r"\1new", string)