in reply to Re: CSV and regex mixups
in thread CSV and regex mixups

I felt kind of bad just giving an opinion and not a useful suggestion so here is my suggestion:
use strict; my $val = '"crosby","stills","nash","and sometimes "young""'; print join "\n", split /(?<="),(?=")/, $val; __OUTPUT__ "crosby" "stills" "nash" "and sometimes "young""
This works if you know you know your fields will always be surrounded by double quotes and there will be no spaces arround the comma. The spaces could be taken care of by using the regex /(?<=")\s*,\s*(?=")/.

--

flounder