in reply to Splitting a comma-delimited string where a substring could contain commas

use perl6 (:regexes); # :-)

Several people have mentioned CSV, but I think your real solution is probabaly to use Test::Balenced to take out the parens properly, and then use a regex to split the data up. Text::Balenced is wildly useful, so learning for this should pay back for other parsing needs. Regexes alone often aren't enough for parsing (at least, not if you want maintainable code).

Cheers,
Erik
  • Comment on Re: Splitting a comma-delimited string where a substring could countain commas
  • Download Code