with open('/var/log/error.log', 'r+') as f:
    data = mmap.mmap(f.fileno(), 0)
mo = re.search('error: (.*)', data)
if mo:
    pass
How do I re.search or re.match on a whole file without reading it all into memory?