Fix assertRegexpMatches deprecation warning in python 3.