我想实现匹配KeyWordFilter以外的汉字
string Chinese=@"[\u4e00-\u9fa5]";
string KeyWordFilter = "一起|一同|到|去|在|与|等人";
string pattern="";
MatchCollection mc = Regex.Matches(input, pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
这个pattern该如何写呢,任何回复都感激不尽...
string Chinese=@"[\u4e00-\u9fa5]";
string KeyWordFilter = "一起|一同|到|去|在|与|等人";
string pattern="";
MatchCollection mc = Regex.Matches(input, pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
这个pattern该如何写呢,任何回复都感激不尽...
Regex validateReg = new Regex("^((?!" + dirtyStr + ").(?<!" + dirtyStr + "))*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
string str = "一起去上海看人";
Console.WriteLine(validateReg.IsMatch(str));