import re


def parse_role_for_profile(role: str) -> str:
    """Returns a 'safe' profile name for a given role.

    Args:
        role: The role to generate a profile name for.

    Returns:
        Formatted profile name.
    """
    account_id = "000000000000"
    role_name = "Unknown-Role-Name"

    account_re = re.compile(r"::(\d+):")
    _account_id = re.search(account_re, role)
    _role_name = role.split("/")
    if _account_id.groups():  # type: ignore[union-attr]
        account_id = _account_id.groups()[0]  # type: ignore[union-attr]
    if len(_role_name) == 2:
        role_name = _role_name[1]

    return "{}-{}".format(account_id, role_name)