using System;
using System.Text.RegularExpressions;
class Program {
static void Main() {
string value = @"apple, orange, ""baboons, cows"", rainbow, ""unicorns, gummy bears""";
string[] lines = Regex.Split(value, @", (?=(?:""[^""]*?(?: [^""]*)*))|, (?=[^"",]+(?:,|$))");
foreach (string line in lines) {
Console.WriteLine(line);
}
}
}
ICAgIHVzaW5nIFN5c3RlbTsKICAgIHVzaW5nIFN5c3RlbS5UZXh0LlJlZ3VsYXJFeHByZXNzaW9uczsKICAgICAKICAgIGNsYXNzIFByb2dyYW0gewogICAgc3RhdGljIHZvaWQgTWFpbigpIHsKICAgIHN0cmluZyB2YWx1ZSA9IEAiYXBwbGUsIG9yYW5nZSwgIiJiYWJvb25zLCBjb3dzIiIsIHJhaW5ib3csICIidW5pY29ybnMsIGd1bW15IGJlYXJzIiIiOwogICAgc3RyaW5nW10gbGluZXMgPSBSZWdleC5TcGxpdCh2YWx1ZSwgQCIsICg/PSg/OiIiW14iIl0qPyg/OiBbXiIiXSopKikpfCwgKD89W14iIixdKyg/Oix8JCkpIik7CiAgICAgCiAgICBmb3JlYWNoIChzdHJpbmcgbGluZSBpbiBsaW5lcykgewogICAgQ29uc29sZS5Xcml0ZUxpbmUobGluZSk7CiAgICB9CiAgICB9CiAgICB9