my $str = "foobarbaz"; my @a = $str =~ /(.)oo(.)ar(.)az/; local $, = ", "; print @a; __OUTPUT__ f, b, b