import re


def StripHTML(input: str) -> str:
    """
    Strip the HTML formatting from a string.

    Parameters
    ----------
    input : str
        HTML formatted string.

    Returns
    -------
    str
        Input string without the HTML formatting.
    """

    # Regex is hideous, but this gets the job done faster than an external
    # library. This is also future-proof against any sort of HTML characters,
    # such as &nbsp and &amp.
    expression: re.Pattern[str] = re.compile(
        "<.*?>|&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});"
    )

    return re.sub(expression, "", input)