Help for this page
my $string = 'aaa:bbb:ccc:ddd:eee:'; my $chunk = '([^:]+:)'; ... my $regex = $chunk x $colons; $string =~ /$regex/; print "$1,$2,$3,$4,$5";