use warnings;
use strict;
use HTML::Tiny;
my @tests = map { 'co'.('m'x$_).'a' } 0..4;
my @regexes = do { no warnings 'qw'; qw/ com?a com*a com+a co(mm)?a
co(m|mmm)a com{2}a com{0,2}a com{2,3}a com{3,}a / };
my $h = HTML::Tiny->new;
print $h->table( {border=>1,cellpadding=>3,cellspacing=>0},
[ \'tr',
[ \'td', '', map { $h->code($_) } @tests ],
map( { my $r=$_;
[ \'td', $h->code("/$r/"),
map( { /$r/
? $h->tag('font', {color=>'green'}, '✔')
: $h->tag('font', {color=>'red'}, '✘')
} @tests ),
]
} @regexes ),
] );