using System;
using System.Text.RegularExpressions;
using System.Linq;
public class Test
{
public static void Main()
{
string[] tests = new string[]{
@"*\\*",
@"*\\\**",
@"*\**",
};
Regex re = new Regex(@"(?:[^*\\]+|\\.)+|\*");
foreach (string s in tests) {
var parts = re.Matches(s)
.OfType<Match>()
.Select(m => m.Value)
.ToList();
Console.WriteLine(string.Join(", ", parts.ToArray()));
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CnVzaW5nIFN5c3RlbS5MaW5xOwpwdWJsaWMgY2xhc3MgVGVzdAp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7ICAgCgkJc3RyaW5nW10gdGVzdHMgPSBuZXcgc3RyaW5nW117CgkJICAgIEAiKlxcKiIsCgkJICAgIEAiKlxcXCoqIiwKCQkgICAgQCIqXCoqIiwKCQl9OwoJCQoJCVJlZ2V4IHJlID0gbmV3IFJlZ2V4KEAiKD86W14qXFxdK3xcXC4pK3xcKiIpOwoJCQoJCWZvcmVhY2ggKHN0cmluZyBzIGluIHRlc3RzKSB7CgkJCXZhciBwYXJ0cyA9IHJlLk1hdGNoZXMocykKICAgICAgICAgICAgIC5PZlR5cGU8TWF0Y2g+KCkKICAgICAgICAgICAgIC5TZWxlY3QobSA9PiBtLlZhbHVlKQogICAgICAgICAgICAgLlRvTGlzdCgpOwogICAgICAgICAgICAgCgkJICAgIENvbnNvbGUuV3JpdGVMaW5lKHN0cmluZy5Kb2luKCIsICIsIHBhcnRzLlRvQXJyYXkoKSkpOwoJCX0KICAgIH0KfQ==