using System;
using System.Text;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var str = "dog:Cat,hi:Bye,num:,1,2,3,5,6,7,8,9,10,this:that";
var result = Regex.Split(str, @",(?=\w+:)");
foreach (var entry in result)
Console.WriteLine(entry);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLlRleHQuUmVndWxhckV4cHJlc3Npb25zOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCXZhciBzdHIgPSAiZG9nOkNhdCxoaTpCeWUsbnVtOiwxLDIsMyw1LDYsNyw4LDksMTAsdGhpczp0aGF0IjsKCgkJdmFyIHJlc3VsdCA9IFJlZ2V4LlNwbGl0KHN0ciwgQCIsKD89XHcrOikiKTsKCQlmb3JlYWNoICh2YXIgZW50cnkgaW4gcmVzdWx0KQoJCSAgICBDb25zb2xlLldyaXRlTGluZShlbnRyeSk7Cgl9Cn0=
dog:Cat
hi:Bye
num:,1,2,3,5,6,7,8,9,10
this:that