from typing import Tuple
import re


def exception_matches(e: Exception, patterns: Tuple[Exception, ...]) -> bool:
    """
    Whether an exception matches one of the pattern exceptions

    Parameters
    ----------
    e:
        The exception to check
    patterns:
        Instances of an Exception type to catch, where ``str(exception_pattern)``
        is a regex pattern to match against ``str(e)``.
    """
    e_type = type(e)
    e_msg = str(e)
    for pattern in patterns:
        if issubclass(e_type, type(pattern)):
            if re.match(str(pattern), e_msg):
                return True
    return False