http://qs321.pair.com?node_id=683957


in reply to Matching lines in 2+ GB logfiles.

The reason for the slow execution is most likely the use of the two .* in the regex which result in a very high number of checks inside the regex machine. This is difficult to explain as long you don't know what backtracking is and how it works.
For now just try this:
while ( $window =~ m/\w{3}\s{1,2}\d{1,2}([^\n]+)\n/oigc && $1 =~ /$re/ +) { &$callback($1); }

Precompiling $re using qr{} is recommended, or use the o option.