using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var parsedValue = new List<List<String>>();
var csv = "A\\B.csproj,\"X\\Y,.csproj\"";
var parser = new Regex(@"(?<=\r|\n|^)(?!\r|\n|$)(?:(?:""(?<Value>(?:[^""]|"""")*)""|(?<Value>(?!"")[^,\r\n]+)|""(?<OpenValue>(?:[^""]|"""")*)(?=\r|\n|$)|(?<Value>))(?:,|(?=\r|\n|$)))+?(?:(?<=,)(?<Value>))?(?:\r\n|\r|\n|$)", RegexOptions.Compiled);
foreach (Match match in parser.Matches(csv))
var currentRow = new List<String>();
foreach (Capture capture in match.Groups["Value"].Captures)
if (capture.Length == 0 || capture.Index == match.Index || match.Value[capture.Index - match.Index - 1] != '\"')
currentRow.Add(capture.Value);
currentRow.Add(capture.Value.Replace("\"\"", "\""));
foreach (Capture OpenValue in match.Groups["OpenValue"].Captures)
parsedValue.Add(currentRow);
foreach (var row in parsedValue)
foreach (var _value in row)
Console.WriteLine(_value);