in reply to Splitting a comma-delimited string where a substring could contain commas
well, thanks for all your answers guys, I fixed it myself this way:
my @temp; if (/(.*)(\([\d\w\s,\.]+?\))(.*)/) { @temp = split /,/, $1; $temp[@temp-1] .= $2; my $last = $3; $last =~ s/^,+//; my @temp2 = split /,/, $last; push (@temp, @temp2); } else { @temp = split /,/, $_; }
I know it's not generic, but it is something I only had to do once
|
|---|