import re


def sanitize_file_name(filename: str, replacement_char: str = "_") -> str:
    """
    Removes illegal characters (for windows) from the string passed.
    """
    return re.sub(r'[\\/*?:"<>|\'\r\n]', replacement_char, filename)