I am writing some code to add html tags to certain phrases. I am trying to find exact matches and replace them with the phrase with tags around them. I am very new to regular expressions and apologize in advance if this is something that should be obvious to me.
For example, if I wanted to bold “black cat” in the following sentence:
I am setting my pattern as \bblack cat\b
The black cat sits on the window sill.
would become
The black cat sits on the window sill.
However, it also changes this:
The black cat’s collar is blue.
to this
The black cat’s collar is blue.
It doesn’t recognize that the 's is part of the word and matches.
Thanks in advance for any help