in reply to Surprisingly poor regex performance
My question is: is there anything I could have told Perl to give it a hint about how to perform the match...?
I'm wondering if a divide-and-conquer approach might give you the same effect, while being clearer to Perl about how to match without needing to backtrack.
while ( $mmap =~ /^(.*\n)/mg ) { my $line = $1; print $line if $line =~ /$pat/; }
|
|---|