Skip to content

Instantly share code, notes, and snippets.

@xdbr
Created May 30, 2016 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdbr/b50968daa9c5f1ba137e50f11fca6ff4 to your computer and use it in GitHub Desktop.
Save xdbr/b50968daa9c5f1ba137e50f11fca6ff4 to your computer and use it in GitHub Desktop.
$rx2 fail
use v6;
use Test;
plan 12;
$_ = "here is some foo";
my $rx1 = "some foo";
my $rx2 = "(some) foo";
my regex a {:s (some) foo }
my regex b {:s $rx1 }
my regex c {:s $rx2 }
my regex d {:s {$rx1} }
my regex e {:s {$rx2} }
isa-ok $_ ~~ /<a>/, Match;
isa-ok $_ ~~ /<b>/, Match;
isa-ok $_ ~~ /<c>/, Match;
isa-ok $_ ~~ /<d>/, Match;
isa-ok $_ ~~ /<e>/, Match;
isa-ok $_ ~~ $rx1, Match;
isa-ok $_ ~~ $rx2, Match;
isa-ok $_ ~~ /$rx1/, Match;
isa-ok $_ ~~ /$rx2/, Match;
isa-ok $_ ~~ /{$rx1}/, Match;
isa-ok $_ ~~ /{$rx2}/, Match;
isa-ok $_ ~~ /:s (some) foo/, Match;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment