Regexp::HTMLify - Highlight regular expression capture buffers and matches using HTML and CSS
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;
This library offers (limited, see below) functionality to highlight regular expression capture buffers using HTML and CSS.
This library has the following limitations:
No support for code execution within regexp; (?{....})
No support for regexp capture buffer quantifiers;
(...)*
(...)+
(...)?
(...){n}
(...){n,}
(...){n,m}
Niels van Dijke <CpanDotOrgAtPerlboyDotNet>
Speedup of HTMLifyREmatches()
Work on capture buffer quantifier limitations
Add support for backrefs (\1, \2 and Perl v5.10.x \g{1}, \g{2})
Add more 'real life' tests and/or examples
Enhance documentation instead of RTFS (read the fine source)
This is alpha code and not extensively tested. Use with care!
Copyright (c) 2008-2011 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.
To install Regexp::HTMLify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Regexp::HTMLify
CPAN shell
perl -MCPAN -e shell install Regexp::HTMLify
For more information on module installation, please visit the detailed CPAN module installation guide.