The way you should trigger is including the regex for matching spaces or non-word characters on each side. For example let’s say you want to hide the following (kinda) naughty word in English
ass
so you replace it with
butt
Well, that’s called a clbuttic mistake … see Obscenity Filters: Bad Idea, or Incredibly Intercoursing Bad Idea?