in reply to Re^5: search for exact word only
in thread search for exact word only
if($action eq '!='){ $match{$a} = 0 if $line[$position]=~m/\Q$key/i; } else{$match{$a} = 1 if $line[$position]=~m/\Q$key/i;}
Is this correct? Please correct me if something wrong:Can be rewritten like so: $match{$a} = ($line[$position] =~ m/\b\Q$key\E\b/i) ? 1 : 0; $match{$a} = !$match{$a} if $action eq '!=';
if($action eq '!='){ $match{$a} = ($line[$position] =~ m/\b\Q$key\E\b/i +) ? 1 : 0; } else{$match{$a} = !$match{$a} if $action eq '!=';}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: search for exact word only
by Roy Johnson (Monsignor) on Sep 29, 2004 at 13:09 UTC | |
by Anonymous Monk on Sep 29, 2004 at 15:28 UTC |