No such thing as a small change | |
PerlMonks |
Re: Search Term Highlightingby gnat (Beadle) |
on Jun 14, 2000 at 22:35 UTC ( [id://18156]=note: print w/replies, xml ) | Need Help?? |
If you have an array of search terms, you can highlight
any one of them with:
That's just a simple extension of sean's code. If your search terms are regexps and not plain strings, then do without the mapping of quotemeta.$re = join "|", map {quotemeta} @term; $results = s{($re)}{$1}ig;
In Section
Seekers of Perl Wisdom
|
|