spanout
asked on
RegEx require to replace items when not links
we have some code that overlays a glossary of terms as jquery popups on html content. It implements this by adding <a> tag around the term to be highlighted. The problem we have is that if the term is within a hyperlink then it corrups the link. We would like to exclude any text that is within a hypelink or other html tags. So, the replacement would take this:
Term1 <a href="#"> term 2</a>
and create this:
<a class=glossary>Term1</a> <a href="#">term 2</a>
term 2 is ignored as it is a hyperlink.
Is this possible?
Term1 <a href="#"> term 2</a>
and create this:
<a class=glossary>Term1</a> <a href="#">term 2</a>
term 2 is ignored as it is a hyperlink.
Is this possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for this, would this regex work in vbscript?
Mine will work with any scripts it´s basic RegEx
Open in new window