def matches_any(cf_stack_name: str, stack_refs: list):
    """
    Checks if the stack name matches any of the stack references
    """

    cf_stack_name = cf_stack_name or ""  # ensure cf_stack_name is a str
    try:
        name, version = cf_stack_name.rsplit("-", 1)
    except ValueError:
        name = cf_stack_name
        version = ""
    return any(ref.matches(name, version) for ref in stack_refs)