'Checks the file for the presence of the regular expression.'

def TestFileContent(self, file_stat):

    try:
        data = ''
        with vfs.VFSOpen(file_stat.pathspec, progress_callback=self.Progress) as fd:
            while (fd.Tell() < self.request.max_data):
                data_read = fd.read(1024000)
                if (not data_read):
                    break
                data += data_read
                if self.request.data_regex.Search(data):
                    return True
                data = data[(-100):]
    except (IOError, KeyError):
        pass
    return False
