def pattern_filter(pattern):
    pattern = re.compile(pattern)

    def _pattern_filter(s):
        return (pattern.search(s) is not None)
    return _pattern_filter
def pattern_filter(pattern):
    pattern = re.compile(pattern)

    def _pattern_filter(s):
        return (pattern.search(s) is not None)
    return _pattern_filter