Hi there
I'm trying to write a regular expression to match a string that isn't part of a link. For example, if I want to match the string "red" and I have the following to haystack:
red is <a href=red.html>fred's</a> friend
Only the red at the beginning of the line should match since the red in "red.html" and the red in "fred's" are part of a link.
I've tried playing around with assertions using preg_replace (I'm trying to replace the matched text with something else), but haven't had much success - never really got the hang on regular expressions.
Any help would be greatly appreciated!
Thanks in advance.