Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Blacklisting with a Regular Expression

by AReed (Pilgrim)
on Aug 18, 2005 at 22:03 UTC ( [id://484971]=note: print w/replies, xml ) Need Help??


in reply to Blacklisting with a Regular Expression

Maybe I'm misunderstanding the problem but does this do what you want?
use strict; use warnings; while(<DATA>) { print unless /(evil|bad|wrong)/i; } __DATA__ This string contains no blacklisted tokens. This string is evil and wrong.

Updated: added i switch.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-25 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found