in reply to RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag
Completely un-optimal, completely un-tested.. but I think I can get away with something like that from your code?
$newline =~ s|(?<!\<)$keyword(?!\>)|<font style="BACKGROUND: #ffffff"> +$keyword</font>|img;
The (?<!\<) implies that this shouldn't match a < before the $keyword, and the (?!\>) shouldn't match a > after it... so it's not in a tag.(I guess)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag
by suaveant (Parson) on Jan 15, 2002 at 02:23 UTC | |
|
Re: Re: RexExp help: Highlight keywords in CGI search results, unless inside an HTML tag
by joealba (Hermit) on Jan 15, 2002 at 02:20 UTC |