Thanks!
The only problem Im still having is that it kind of does the opposite of what I want.
I am replacing the words with a hyperlink.
So... I do not want to replace any of the words that are already linked... or any of the words within a link tag.
i.e.
Change the underlined versions of bob to <a href="bob.htm">bob</a>
My name is bob and the home page of bob is: <a href="www.bob.com">Bobs homepage</a> thanks... Bob
Hope this makes sense and I am not asking for the impossible!
I know it would be very costly... but your code has given me an idea... what if I were to do a preg_replace on the items I DONT want matched to make them not come up a match... i.e. stick a placeholder like <--ACK--> so the above sentence looks like:
My name is bob and the home page of bob is: <a href="www.b<--ACK-->ob.com">B<--ACK-->ob</a>
Then I could do my original preg_replace and then a str_replace to remove all <--ACK-->'s
I hope there is a better way as that sounds REALLY pants to me. Thats 3 scans for each word I want to replace!
Please help!!!