I need to run a regex match over a file, but I'm faced with an unexpected problem: the file is too big to read() or mmap() in one call, File objects don't support the buffer() interface, and the regex module takes only strings or buffers.
Is there an easy way to do this?
mmap()the file. I've done this with files up to 30 GB, in Python, and it works great.mmap()it. Post it as an answer (maybe provide some code in case someone else stumbles upon this) and I'll accept it!