I have a pretty rude and not a very efficient filter in a forum. I want to be able to detect words that we do not accept in the forums. The filter works like this today:
sPattern = "[\s,.!?]" & aBadWord & "[\s,.!?]"
If Regex.IsMatch(sTextToCheck, sPattern, RegexOptions.IgnoreCase) Then
bWordFound = True
End If
Or in this way regarding some words:
sPattern = aBadWord
If Regex.IsMatch(sTextToCheck, sPattern, RegexOptions.IgnoreCase) Then
bWordFound = True
End If
But it is pretty easy to circumvent the filter by using asterisk, like aBadWord becomes aB ...
Go to the complete details ...