def greplines(pattern, lines):
    """Given a list of strings *lines* return the lines that match
    pattern.

    """
    res = []
    for line in lines:
        match = re.search(pattern, line)
        if match is not None:
            res.append(line)
    return res
def greplines ( pattern , lines ) : res = [ ] for line in lines : match = re . search ( pattern , line ) if match is not None : res . append ( line ) return res
Given a list of strings *lines* return the lines that match
    pattern.