I have a line:
$myline = 'ca,cb,cc,cd,ce';
I need to match ca into $1, cb into $2, etc..
Unfortunately
$myline =~ /(?:(\w+),?)+/;
doesn’t work. With pcretest it only matches ‘ce’ into $1.
How to do it right?
Do I need to put it into the while loop?
Why not use the
splitfunction:splitsplits a string into a list of strings using the regular expression you supply as a separator.