Maybe pre-compiling the regex would speed things up, so the regex isn't compiled for each line? It's in the faq somwhere.
my $bigpattern = '(' . join('|',@patterns) . ')'; $b = qr/\Q$bigpattern\E/; while (my $inputline = <FILE>) { if ($inputline =~ /$b/io) { ## Logic goes here } }
In reply to Re: Bulk Regex?
by zentara
in thread Bulk Regex?
by meetraz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |