Perl regex acceleration