Compiling regexp beforehand, for python 2.4 flag support

Premature optimization is the root of all evil, and all that jazz