in reply to Filtering Source Text File with 2nd Text File of Terms
Please note that unescaped special characters in strings used as patterns could give unpredictable results!!!
Example: the term "www.thisisannoying.com" will also match lines with "wwwithisisannoyingacom"...
If the terms from the list are single words, probably the test from previous posts should be:
print "$source\n" unless grep { $source =~ /\b$_\b/ } @terms;where \b is used to check for word boundaries, so "googleeee" won't be matched by "google" term.
|
---|
In Section
Seekers of Perl Wisdom