The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

    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;

DESCRIPTION

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

LIMITATIONS

This library has the following limitations:

  • No support for code execution within regexp; (?{....})

  • No support for regexp capture buffer quantifiers;

    • (...)*

    • (...)+

    • (...)?

    • (...){n}

    • (...){n,}

    • (...){n,m}

AUTHOR

Niels van Dijke <CpanDotOrgAtPerlboyDotNet>

TODO

  • 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)

NOTES

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

COPYRIGHT

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.