import re


def format_CEP(CEP: str) -> str:
    """Remove invalid characters from CEP.
    Args:
        CEP (str): The CEP string to format.

    Returns:
        str: The formated CEP.
    """
    CEP = re.sub(r'[^0-9]', '', CEP)
    return CEP