using System;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var isMatch1 = new Regex(@"[^a]*|[^a]*a[^b]*").IsMatch("ab");
Console.WriteLine("[ab] {0}", isMatch1);
var isMatch2 = new Regex(@"[^a]*|[^a]*a[^b]*|[^a]*a[^b]*b[^c]*").IsMatch("abc");
Console.WriteLine("[abc] {0}", isMatch2);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJdmFyIGlzTWF0Y2gxID0gbmV3IFJlZ2V4KEAiW15hXSp8W15hXSphW15iXSoiKS5Jc01hdGNoKCJhYiIpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKCJbYWJdIHswfSIsIGlzTWF0Y2gxKTsKCQl2YXIgaXNNYXRjaDIgPSBuZXcgUmVnZXgoQCJbXmFdKnxbXmFdKmFbXmJdKnxbXmFdKmFbXmJdKmJbXmNdKiIpLklzTWF0Y2goImFiYyIpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKCJbYWJjXSB7MH0iLCBpc01hdGNoMik7Cgl9Cn0=