in reply to Matching and making accesible an arbitrary number of subpatterns w/a regex?
There was yet only one (kwaping) who correctly answered the OP's question.
Here is my solution to it:
my $string = 'aaa:bbb:ccc:ddd:eee:'; my $regex= $string; $regex=~ s/[^:]*:/([^:]*:)/g; $string =~ /$regex/; print "$1,$2,$3,$4,$5";
|
|---|