import re


def re_contains(a, b):
    """Return True if a regex search with pattern b yields a match in a

    Args:
        a (str): Pattern to search
        b (str): Regex pattern to use in search

    Returns:
        result (bool): Whether b contains a or not.
    """

    try:
        regexp = re.compile(b, flags=re.IGNORECASE)
    except(TypeError):
        raise TypeError('Value must be a string that can be compiled to regex expression')

    return bool(re.search(regexp, a))