This could use `re.sub` as well.