I am trying to construct a regex for keyword autolink in html. the keyword should only match if it's
(1) outside a html tag and
(2) not between the <a..></a> tags since this would mean it is already a part of a link and shouldn't be autolinked again.
So, in the following code if I am looking to autolink "apple":
Code: Select all
The big red apple was growing on an <a href="appletree.com" title="apple tree">Apple Tree</a>
<img src="apple.gif" title="apple tree">
Any tips would be greatly appreciated!!