in reply to Re^2: Out of memory!
in thread Out of memory!

I' not sure i'm understood what you want, here is my piece of code, maybe it helps. If url exclude list is too, you can just split it into smaller batches and collect "match id" results (maybe some of them multiple times)
use re 'eval'; my @url_list = qw( www.gmaisds.% www.gmai% www.go% www.gir% www.girs% +); my @list; my $retval; my $id = 0; for my $url (@url_list) { $url =~ s/(?=[\/\.\?])/\\/g; $url =~ s/%/.*/g; $url .= '(?{ use re \'eval\'; $retval = ' . $id++ . '})'; push @list, $url; } my $str = '^(?:' . join (')|(?:', @list) . ')$ '; my $re = qr($str); while (<>) { chomp; if ($_ =~ $re) { print "$_ excluded; id: $retval\n"; } }