in reply to Re: RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag
in thread RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag

There is nothing wrong with having a < before or a > after it.. so long as the < has a > after it before and vice versa for after.... so I don't think yours will quite work...
I came up with the following... which seems to work at least somewhat...
s|(\Q$text\E)(?![^<]*>)|<I>$1</I>|gi;
which matches the text so long as it is not followed by a > before it sees a <

Update \me laughs as joealba and I both post the code I gave him at the same time...

                - Ant
                - Some of my best work - (1 2 3)

  • Comment on Re: Re: RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag
  • Download Code