Regexp performance improvements.