1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
use strict;
use warnings;
use Test::More tests => 3;
use Data::Printer::Object;
my $ddp = Data::Printer::Object->new( colored => 0 );
my $regex_with_modifiers = qr{(?:moo(\d|\s)*[a-z]+(.?))}i;
is(
$ddp->parse(\$regex_with_modifiers),
'(?:moo(\d|\s)*[a-z]+(.?)) (modifiers: i)',
'regex with modifiers'
);
my $plain_regex = qr{(?:moo(\d|\s)*[a-z]+(.?))};
is(
$ddp->parse(\$plain_regex),
'(?:moo(\d|\s)*[a-z]+(.?))',
'plain regex'
);
my $creepy_regex = qr{
|
^ \s* go \s
}x;
is(
$ddp->parse(\$creepy_regex),
"\n |\n ^ \\s* go \\s\n (modifiers: x)",
'creepy regex'
);
|