Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by vitoco (Hermit)
on Apr 03, 2012 at 17:53 UTC ( [id://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 "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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://963286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found