<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _check_regex(minion_id, regex):
    '''
    check whether or not this minion should have this external pillar returned

    :param minion_id: str
    :param minion_regex: list
    :return: bool
    '''
    get_pillar = False
    for pattern in regex:
        log.debug('nsot external pillar comparing %s with %s', minion_id, regex)
        match = re.search(pattern, minion_id)
        if match and match.string == minion_id:
            log.debug('nsot external pillar found a match!')
            get_pillar = True
            break
        log.debug('nsot external pillar unable to find a match!')
    return get_pillar