Search::Tools::HiLiter 0.06 reviewDownload
Search::Tools::HiLiter is a Perl module to extract and highlight search results in original text. SYNOPSIS use Search::Tools::
Search::Tools::HiLiter is a Perl module to extract and highlight search results in original text.
my $re = Search::Tools::RegExp->new;
my $rekw = $re->build('the quick brown fox');
my $hiliter = Search::Tools::HiLiter->new( rekw => $rekw );
for my $text (@texts)
print $hiliter->light( $text );
Search::Tools::HiLiter uses HTML tags to highlight text just like a felt-tip HiLiter. S::T::H can handle both plain and marked up text (HTML and XML). Nested entities and tags within keywords are supported.
You create a HiLiter object with either a string, an array of strings, or a Search::Tools::RegExp::Keywords object, and then feed the HiLiter text to highlight. You can control the style and color of the highlight tags.
Some caveats if you are highlighting HTML or XML: Unlike its more powerful cousin HTML::HiLiter, S::T::H knows nothing about context. This can give unexpected results when your keywords appear in the HTML or across block tag boundaries. Use HTML::HiLiter if you need a real HTML parser. It uses the same regular expressions as S::T::H but is designed for full HTML documents rather than smaller fragments.
Search::Tools::HiLiter 0.06 keywords