Let’s say I have the following raw text:
<p>
This is a demonstration of the plugin "Context Links." This demonstration is set to work on two parents with IDs of 110 and 111. Parent 110 has children "Concord" and "Riesling." Parent 111 has children "Chambourcin," "Chambourcin Reserve" and "Villard Blanc." The paragraph below, as it existed before the plugin converted it, only had the word "Chambourcin" linked. The others are all plain text, and were dynamically converted to point to the correct document.
</p>
<p>
Please try our wonderful <a href="[~112~]" title="Chambourcin">Chambourcin</a>, Chambourcin Reserve, Villard Blanc, Concord, and Riesling.
</p>
If I want to replace every instance of "Chambourcin" unless it is inside an anchor or is an attribute for html. Original I had:
However, the replaces "Chambourcin" even when it is part of the title attribute and inside the anchor element. So then I tried:
This eliminates it from finding "Chambourcin" when it is the title attribute and inside the anchor tag, but has the undesired effect of matching ";Chambourcin" and " Chambourcin". How can I eliminate what I am trying to eliminate, while still having it only match "Chambourcin" and respecting its word boundaries?