不匹配一个单词
string[] slist = { "shit", "no", "SHIT", "xxsHitxx" };
Regex re = new Regex(@"^(?!.*(?i:shit))");
foreach (string s in slist)
Console.WriteLine("{0} matches? {1}", s, re.IsMatch(s));
Regex re = new Regex(@"^(?!.*(?i:shit))");
foreach (string s in slist)
Console.WriteLine("{0} matches? {1}", s, re.IsMatch(s));