my regex line { ^^ (\w+) :my $s; \h+ $s $=\N* $s # Note the foo bit here ... $$ } is ('bang !one!' ~~ m//), 'one', 'is bang!one'; # ... and here #### grammar g { regex TOP { # drop 'my'; name 'TOP' to simplify .parse call in `is` test ^^ (\w+) :my $s; \h+ $s $=\N* $s $$ } } is g.parse('bang !one!'), 'one', 'is bang!one'; # calling .parse method on grammar defaults to starting with rule (regex) named 'TOP'