def METHOD_NAME(accepted_filters, filters):
    filter_regex = rf"Name=({'|'.join(accepted_filters)}),Values=[\w\-_.,]+"
    pattern = re.compile(rf"^({filter_regex})$")
    def fail(provided):
        raise BadRequestException(f"provided filters parameter '{provided}' must be in the form {pattern.pattern}.")
    # Check each filter with the regex
    for f in filters:
        if not pattern.match(f):
            fail(f)
    return filters