After asking [this perl newbie question](https://stackoverflow.com/questions/9329245/regex-to-match-whole-word-with-a-particular-definition-of-a-word), I have a perl newbie follow-up. I have discovered the one case in which using the word boundary fails for the purposes of my application which does this regex search and replace over a set of files:

```
s/\bcat\b/cat_tastic/g

```

Which is that I would also like for -cat to not be a match for replacement, although it is currently a match since the hyphen is considered a word boundary. I have read up on word boundaries but what I've learned is that creating a change to boundary conditions when using \b is non-trivial. How do I exclude "-cat" from being searched and replaced? So the end result is:

```
:cat { --> :cat_tastic {
:catalog { --> no change
-cat { --> no change

```

This doesn't have to be part of the one line search and replace, it can also be a condition previous to the search and replace which controls whether the search and replace is executed, although having it in the search and replace would be most useful.