Fixed issue with regex on Python 3.2