Jethro commented on a Page, ban on certain words  -  May 09, 2011

The way you have it, for instance:> blah blah blah word1 blah <- This won't trigger.

word1 <- this will trigger, but on a one-word basis. In other words, it'll trigger when nothing attaches to or follows it.

Take out the ^ and $ so the bad words will be matched in a sentence.

It's ok if you need to watch out for a few bad words using the on text regex approach. It's not recommendable if you want to look out for more bad words or add or delete more of them.

The best method I've known is using a hash table and

$hfind(badwords,$strip($1-),1,w).data

to match against words added in it. You can also use the -r switch for regex. word1|word2|word3|etc.. to be stored in hash table's data.

I won't go into detail of the hash table if you don't know about it. Read up on it at your leisure.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.