$str ~~ mm/foo [ m (\d+) ]* bar/; my @matches = @$0;