qr %
([^<]*(?:<(?!b>|/p>)[^<]*)*)
%i; ####
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw /cmpthese/;
our $abigail = qr %([^<]*(?:<(?!b>|/p>)[^<]*)*)
%i;
our $bart = qr %((?:(?!).)+?)
%is;
our $corion = qr %((?:[^<]*|<(?!b>)[^>]+>)*?)
%i;
my @names = qw /abigail bart corion/;
our @data = ;
my @correct = ('Just another perl hacker',
'this should match',
'What about this?',
'And this');
cmpthese -1 => {map {$_ => "\@$_ = map {/\$$_/g} \@data"} @names};
no strict 'refs';
"@$_" eq "@correct" or die ucfirst for @names;
__DATA__
Just another perl hacker
Just another perl hacker
this should match
This should not match
What about this?
And
this
malformed piece?
Rate corion bart abigail
corion 6457/s -- -68% -72%
bart 19910/s 208% -- -14%
abigail 23209/s 259% 17% --