I would like to write a regular expression in javascript to match specific text, only when it is not part of an html link, i.e.
match <a href="/link/page1">match text</a>
would not be matched, but
match text
or
<p>match text</p>
would be matched.
(The "match text" will change each time the search is run - I will use something like
var tmpStr = new RegExp("\bmatch text\b","g");
where the value of "match text" is read from a database.)
So far my best effort at a regular expression is
\bmatch text\b(?!</a>)
This deals with the closing , but not the initial . This will probably work fine for my purposes, but it does not seem ideal. I'd appreciate any help with refining the regular expression.