Hi everyone!
I have a regex problem I could use your help with:
I am using PHP to preg_replace words within a block of text with hyperlinks, but when the word is already in an hyperlink, it is still turned into a link. Basically the preg_replace regex I am using is "double linking" the word.
In order to solve this I need some help in coming up with a regex that will match only words that are NOT in any html tags.
The preg_replace I am using now is a simple word match: preg_replace("/\bword\b/","<a href=\"http://www.example.com\">Word</a>",$text);
Thanks in advance for any help!
Craig