def METHOD_NAME(self, regex):
    """ Find the filenames that match a certain regex
    on lines that aren't comments """
    filenames = []
    reg = re.compile(regex)
    fname_re = re.compile(r'[a-zA-Z]\w+\.\w{1,5}$')
    for line in self.cfile.splitlines():
        if len(line.strip()) == 0 or line.strip()[0] == '#':
            continue
        for word in re.split('[ /)(\t\n\r\f\v]', line):
            if fname_re.match(word) and reg.search(word):
                filenames.append(word)
    return filenames