Let's say I want to match the phrase 'Johnny Appleseed' and we are given the following string:
<p>Johnny random blah stuff</p>
<p>more random stuff Appleseed blah blue bleh</p>
I would like to be able to match Johnny and Appleseed in order to wrap those words in a tag, how can I go about this?
Expected output:
<p><span>Johnny</span> random blah stuff</p>
<p>more random stuff <span>Appleseed</span> blah blue bleh</p>
Thanks for all advice!
Note: Basically what I want is what this page is automatically doing with the words Johnny and Appleseed in the example string (its making Johhnny and Appleseed be different colors than the other text)