I'm trying to write a regular expression to replace a 'key phrase' with a link IF it's not already inside an <a> tag.
For example:
...<a href="link.html">key phrase</a>... doesn't match
...<a href=link.html>here's a key phrase example</a>... doesn't match
...<p>this key phrase isn't in an a tag</p>... does match and i'd like this to be replaced with:
...<p>this <a href="link.html">key phrase</a> isn't in an a tag</p>...
It seems that I'll need to use complex 'lookarounds' but they don't seem to support much...
One of the tricky parts is matching just the key phrase, not the rest of the text around it. The strings being 'regexed' are more than one line and are likely to have many <a> tags already in them.
Thanks very much for any help you guys can give me 🙂