Find text and wrap with markup (or replace)

Find text and wrap with markup (or replace)

I have been trying to figure out how to find all instances of a certain word or phrase within an element and wrap those words in <span> tags or other html. 

I.e. change all instances of 'the keywords' to <span>the keywords</span>

So far I've found a lot of references to :contains() but that will change the element the text is inside of rather than just the text itself.  Any advice or references would be much appreciated.