I'm trying to make a word filter system, and I've got a table full of words and the replacement words, etc, but my regular expression isn't replacing them properly. I want to be able to set filters to loose or exact. Loose meaning that all instances of the word will be replaced, even if they occur inside another word. Exact means only the exact word will be replaced. Simple enough, or so I thought.
I have a field in the table called Type, which is a bit. If it's 1, then it's exact, if it's 0, then it's loose.
Here's the code I have for that:
Are my patterns wrong? I'm guessing they are.
Also, I don't know why, but it's not ignoring the case, even though I have set regex.IgnoreCase to true. Any thoughts?