my $str = '1,2,3,"4,5,6"'; .say for $str.split(/','/) # Or use comb?
输出应该是:
1 2 3 "4,6"
my $str = '1,6",7,8'; .say for $str.comb: / <-[",]>+ | <["]> ~ <["]> <-["]>+ / ;