while (my $line = <$pattern_fh>) { chomp $line; # Use quotemeta to allow for items like A[0] push @tokens, quotemeta($line); } my $pattern = '^(?:' . join('|', @tokens) . ')[^a-zA-Z]*$'; print "Search pattern: $pattern\n";
In reply to Re^7: Search and delete lines based on string matching
by imp
in thread Search and delete lines based on string matching
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |