use 5.010; use warnings; use Test::More 'no_plan'; use Regexp::Grammars; my $raw_hash = qr{ \A (?: | | | ) \Z \d{1,3} % % \w+ % \d{1,3} \% solution }xms; no Regexp::Grammars; ok +('7% solution' =~ $raw_hash) => 'Matched '; ok exists $/{solution} => '...and matched correct rule'; ok +('7%' =~ $raw_hash) => 'Matched '; ok exists $/{percentage} => '...and matched correct rule'; ok +('%foo' =~ $raw_hash) => 'Matched '; ok exists $/{perl_hash} => '...and matched correct rule'; ok +('%bar % 42%' =~ $raw_hash) => 'Matched '; ok exists $/{perl_mod} => '...and matched correct rule';