Gossamer Forum
Home : General : Perl Programming :

finding exact string match

Quote Reply
finding exact string match
i have a censoring routine that contains the following lines:
Code:
@dirty_words = ('fuck','shit','cocksucker','asshole','cunt','pussy','tits','bastard','bitch','piss','darksites','myrealbox','penis','cialis','viagra');
foreach $dirty_word (@dirty_words) {
if (lc($in{$col}) =~ /$dirty_word/) {
....



$in{$col} is the form input

if i enter shitake (mushroom), it rejects the value because it is matching shit. i have tried multiple things and none work. i'm sure it must be something simple but i can't figure it out. please help.
Subject Author Views Date
Thread finding exact string match delicia 2916 Jul 27, 2021, 5:29 PM
Thread Re: [delicia] finding exact string match
delicia 2885 Jul 27, 2021, 5:34 PM
Thread Re: [delicia] finding exact string match
Andy 2874 Jul 29, 2021, 12:30 AM
Thread Re: [Andy] finding exact string match
delicia 2864 Jul 29, 2021, 1:51 PM
Thread Re: [delicia] finding exact string match
Andy 2859 Jul 29, 2021, 11:26 PM
Thread Re: [Andy] finding exact string match
delicia 2844 Jul 30, 2021, 10:30 AM
Post Re: [delicia] finding exact string match
Andy 2834 Jul 30, 2021, 10:45 PM