import re


def search(regex, fullpath):
    """
    Return True if and only if the given regex matches any line of the given file.
    """

    p = re.compile(regex)
    for line in open(fullpath):
        if p.search(line):
            return True

    return False