Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Filtering Source Text File with 2nd Text File of Terms

by vitoco (Friar)
on Apr 03, 2012 at 17:53 UTC ( #963286=note: print w/replies, xml ) Need Help??

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 "" 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963286]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-02-23 21:37 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (351 votes). Check out past polls.