I have a regular expression that simply replaces a given word with the the same word surrounded by a SPAN tag to highlight it, like this:
oRegExp.Pattern = "(" & aSearch(nTerm) & ")"
sArticle = oRegExp.Replace(sArticle,"<span style=""background-color:#FFFF00"">$1</span>")
The problem is, if someone searches for something that is within an HTML tag, like if they search for SPAN, then it busts up the HTML. So... I need a new regular expression that only finds the keywords if they NOT with < > tags.
Am I wanting too must from a regular expression? Should I do this some other way that would be more efficient?