CSharp · Console
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
public class Program
{
public static void Main()
{
var input = "1,\"TEST\",22345,\"18,95\", Ab\"cde,1,2,,4";
List<string> results = Regex.Matches(input, @"(?<=^|,)(?:""(?<value>.*?)""|(?<value>[^,]*))(?=,|$)")
.Cast<Match>()
.Select(m => m.Groups["value"].Value)
.ToList();
results.ForEach(r => Console.WriteLine(r));
}
}