'helper for _block_matches: does the target (field value) match the criteria?
If target is a list, do any of the list elements meet the criteria
If the criteria is a regex, does the target match it?
If the criteria is a function, does invoking it on the target yield something truthy?
If criteria is a dict {($nin|$in): []}, then do (none|any) of the list elements meet the criteria
Otherwise, is the target == criteria'

def _value_matches(self, target, criteria):

    if isinstance(target, list):
        return any((self._value_matches(ele, criteria) for ele in target))
    elif isinstance(criteria, re._pattern_type):
        return (criteria.search(target) is not None)
    elif callable(criteria):
        return criteria(target)
    elif (isinstance(criteria, dict) and ('$in' in criteria)):
        return any((self._value_matches(target, test_val) for test_val in criteria['$in']))
    elif (isinstance(criteria, dict) and ('$nin' in criteria)):
        return (not any((self._value_matches(target, test_val) for test_val in criteria['$nin'])))
    else:
        return (criteria == target)
