
Regexp::HTMLify - Highlight regular expression capture buffers and matches using HTML and CSS

use CGI qw/:standard/;
use Regexp::HTMLify;
my $re = qr((?i)(This) (?!and not that )(will match));
my $match = 'This will match';
my @titles = qw(this matches);
print
start_html('A simple example of Regexp::HTMLify'),
HTMLifyGetColormapCSS(),
p('Regexp: ',HTMLifyRE($re,@titles));
if ($match =~ m#$re#) {
print p('MATCH :',HTMLifyREmatches($match,@titles));
} else {
print p('NO match');
}
print end_html;
The above example will produce the following HTML:

This library offers (limited, see below) functionality to highlight regular expression capture buffers using HTML and CSS.

This library has the following limitations:

Niels van Dijke <CpanDotOrgAtPerlboyDotNet>


This is alpha code and not extensively tested. Use with care!

Copyright (c) 2008 Niels van Dijke mailto:CpanDotOrgAtPerlboyDotNet http://PerlBoy.net All rights reserved. This program is free software.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.