3 ms·
If I understand correctly, pcre = Perl Compatible Regular Expressions. While that library attempts to be able to do most of what perl regex can do (or could do
by senorsmile 11y ago
If I understand correctly, pcre = Perl Compatible Regular Expressions. While that library attempts to be able to do most of what perl regex can do (or could do a while ago as it doesn't seem to keep up with modern Perl versions), it doesn't implement the entirety. Perl itself doesn't use that library, but is an optimized engine built into perl that provides the basis that pcre is based off of.
It's not surprising that the Perl is faster, as it is all in C, and has had lots of optimizations over a few decades. I've had similar results between perl and things like grep, Ruby, python etc. Perl comes out on top!