Raised This Month: $ Target: $400
 0% 

Replace blacklisted word unless it's a part of whitelisted word - string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-08-2014 , 16:00   Re: Replace blacklisted word unless it's a part of whitelisted word - string
Reply With Quote #2

Removing whitespaces actually makes it harder. The best way that I can think of is to use regex finding the word that contains "shit" but also include wild cards to get the whole word. Then, you can run that through your whitelist to see if you should block it or not.

regex: \b\w*shit\w*\b

This should return "doshite" which you then run through your whitelist. It no in the whitelist, assume it's a bad word.

(Do NOT remove spaces)
__________________

Last edited by fysiks; 03-08-2014 at 16:00.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode