Improved regex module for python

Taken from: https://code.google.com/p/mrab-regex-hg/