I saw in the wiki page http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines
that python use non-recursive implementation as grep and sed while perl one uses the simple cursive impl. does this indicate that python’s regex performance is faster than perl’s?
This is not a direct answer because the answer to the Python v. Perl regex question seems to be “it depends”.
If you are concerned about regex speed, there are a few things you should look into. One is to use plain search and replace, where possible, instead of regex.
The other is to use Google’s re2 module, which has good wrappers in a number of languages. In my experience, re2 is about 60% faster than the built-in re module in Python, and where it particularly shines is with “pathological” regex expressions that could take much longer than you’d expect using the built-in module. All this and more is explained here, in the paper by Russ Cox, who developed re2.
In Python, I use and can vouch for pyre2, a wrapper for re2, which acts as a drop-in replacement for re. A CPAN search shows that re::engine::RE2 appears to serve the same function in Perl.