def METHOD_NAME(filename: str, pattern: str, replacement: str) -> None:
    with open(filename, 'r+') as f:
        content = f.read()
        overwritten_content = re.sub(pattern, replacement, content, flags=re.M)
        f.seek(0)
        f.write(overwritten_content)
        f.truncate()