I would guess you can have more control with preg_replace but it would be more complicated.
The problem is if you replace “dog” with “cat” and you have a doghouse in a sentence it would become a cathouse. This is where preg_replace may come into its own as you could instruct it to only change the word if it had for instance a white space before or after the selected word.