OK, I'll have to do a bit of explaining first, so here goes.
I am looping through a document and for this example, I'm going to replace the words documentation and process.
On the first loop, it replaces the word documentation with the following for a javascript tooltip:
<span style=" border-bottom : 2px dashed #007700; cursor : help;" onmouseover="return escape('There is a process for documentation')">documentation</span>
That works just fine. Now, the issue is, notice the word process in the tooltip area. On the second loop, it wants to replace the word process inside there with the same sort of code so it's creating something like
<span style=" border-bottom : 2px dashed #007700; cursor : help;" onmouseover="return escape('There is a <span style=" border-bottom : 2px dashed #007700; cursor : help;" onmouseover="return escape('This is a process')">process</span> for documentation')">documentation</span>
Now, you can see the issue, the span w/in a span that's within a JS call.
Sure, this is all JS now, but, what I need is the regular expression to ONLY replace if there is NO <span> before it:
<span style=" border-bottom : 2px dashed #007700; cursor : help;" onmouseover="return escape('
So, basically search the document for the next word(could be any) and ONLY replace the word if it's by itself and does NOT have the above before it.
NOTE: there can be any # of characters between the end of the above line and the beginning of the word_to_be_searched*