in reply to Matching and making accesible an arbitrary number of subpatterns w/a regex?
my $string = 'aaa:bbb:ccc:ddd:eee:'; my $chunk = '([^:]+:)'; my $colons =()= $string =~ /:/g; my $regex = $chunk x $colons; $string =~ /$regex/; print "$1,$2,$3,$4,$5";
|
|---|