import re


def match_cors(pattern, value):
    """
    Match the value of a CORS header against the specified pattern.
    """
    pattern_parts = pattern.split('*')
    if len(pattern_parts) == 1:
        return pattern == value
    # protect all non-alphanumerics (except wildcards) as we keep them as is
    regex = '^' + '.*'.join([re.escape(p) for p in pattern_parts]) + '$'
    return re.match(regex, value) is not None