in reply to Re: split on comma-separated fields, where a field may have commas inside quotes
in thread split on comma-separated fields, where a field may have commas inside quotes
I like that; I'll try to remember it.
But the first asterisk yields empty chunks; fixed with a plus:
@chunks = $str =~ /[^,"]+(?:"[^"]*"[^,"]*)*/g;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: split on comma-separated fields, where a field may have commas inside quotes
by JavaFan (Canon) on Jun 10, 2009 at 14:28 UTC | |
Re^3: split on comma-separated fields, where a field may have commas inside quotes
by CountZero (Bishop) on Jun 10, 2009 at 18:33 UTC |