def get_ks001_extension(filename: str, pipe: str = "|") -> str:
    """
    get extension of filename

    filename extension is the string going from the end till the last dictionary separator.

    For example |a=5_b=2|.csv will return "csv"
    For example |a=5_b=2|.original.csv will return "original.csv"
    For example |a=5_b=2|csv will lead to UB

    :param filename: the filename to check. Implicitly under KS001 format
    :param pipe: the character used by KS001 to divide dictionaries
    :return: the extension. May contain multiple "."
    """

    return filename[filename.rfind(pipe)+2:]