I've no idea what I'm doing wrong but unfortunately for me, both a bare $RE... and #$RE... fails for me.

use 5.026; use Carp; use Data::Dumper; use Readonly; use Regexp::Common qw[ delimited ]; use Regexp::Grammars; use Try::Tiny; BEGIN { say "Regexp::Common: $Regexp::Common::VERSION"; say "Regexp::Grammars: $Regexp::Grammars::VERSION"; } try { my $grammar = qr{ <nocontext:> <TEST> <rule: TEST> <Quoted_String> <token: Quoted_String> $RE{delimited}{-delim=>q{'}}{-esc=> +q{'}} }; if (q{'some string with containing a '''} =~ $grammar) { warn Data::Dumper->new([\%/],[qw(*/)])->Deepcopy(1)->Indent(1) +->Maxdepth(3)->Sortkeys(1)->Dump(),q{ }; }; } catch { Carp::cluck $_ }; # line 24 try { my $grammar = qr{ <nocontext:> <TEST> <rule: TEST> <Quoted_String> <token: Quoted_String> #$RE{delimited}{-delim=>q{'}}{-esc= +>q{'}} }; if (q{'some string with containing a '''} =~ $grammar) { warn Data::Dumper->new([\%/],[qw(*/)])->Deepcopy(1)->Indent(1) +->Maxdepth(3)->Sortkeys(1)->Dump(),q{ }; }; } catch { Carp::cluck $_ }; # line 36

yields

>perl re.t Regexp::Common: 2017060201 Regexp::Grammars: 1.057 Not a SCALAR reference at C:/berrybrew/5.32.1_64/perl/site/lib/Regexp/ +Grammars.pm line 106. at ..\..\test\re.t line 24. main::catch {...} ("Not a SCALAR reference at C:/berrybrew/5.3 +2.1_64/perl/site/li"...) called at C:/berrybrew/5.32.1_64/perl/lib/Tr +y/Tiny.pm line 123 Try::Tiny::try(CODE(0xf9c1a0), Try::Tiny::Catch=REF(0x2819630) +) called at ..\..\test\re.t line 24 Not a SCALAR reference at C:/berrybrew/5.32.1_64/perl/site/lib/Regexp/ +Grammars.pm line 106. at ..\..\test\re.t line 36. main::catch {...} ("Not a SCALAR reference at C:/berrybrew/5.3 +2.1_64/perl/site/li"...) called at C:/berrybrew/5.32.1_64/perl/lib/Tr +y/Tiny.pm line 123 Try::Tiny::try(CODE(0xf9c1a0), Try::Tiny::Catch=REF(0xe581f8)) + called at ..\..\test\re.t line 36

In reply to Re^2: How to use Regexp::Common patterns in Regexp::Grammars? (Properly) by clueless newbie
in thread How to use Regexp::Common patterns in Regexp::Grammars? by clueless newbie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.