def filter_regex ( names , regex ) : return tuple ( name for name in names if regex . search ( name ) is not None )
python return regex match groups as tuple
Return a tuple of strings that match the regular expression pattern .
def filter_regex(names, regex):
    """
    Return a tuple of strings that match the regular expression pattern.
    """
    return tuple(name for name in names
                 if regex.search(name) is not None)