Subject: | This program doesn’t stop running |
Date: | Mon, 11 Dec 2017 11:12:57 +0200 |
To: | bug-Regexp-Grammars [...] rt.cpan.org |
From: | Alexander Karelas <alex.karelas [...] gmail.com> |
Which means i cannot use regexes inside require blocks, i think? But thats bad because how else can i say: i want this word to match one of these regexes but also not match one of those regexes? I see no other way to do it
Show quoted text
> #!/usr/bin/env perl
>
> use v5.16;
> use warnings;
> use lib 'local/lib/perl5';
>
> use Regexp::Grammars;
> use Test::More;
> use DDP;
> use Data::Dumper;
>
> my $grammar = qr/
>
> \A <item> \z
>
> <token: item>
> (\S+)
> <require: (?{ no Regexp::Grammars; $CAPTURE != m!! })>
>
> /;
>
> my $matches = 'Peter' =~ $grammar;
>
> my $struct = {
> matches => $matches,
> hashref => \%/,
> errors => \@!,
> };
>
> p $struct;