/// <summary>
/// 过滤关键字
/// </summary>
/// <param name="value">过滤字眼,用| 隔开</param>
/// <param name="text">传入要过滤的数据</param>
/// <returns></returns>
public List<string> FriterText(string value, string text)
{
List<string> FriterList = new List<string>();
String regex = string.Format("({0})", value);
//String regex = "(插你|企业|企业家)";
Regex rg = new Regex(regex);
if (rg.IsMatch(text))
{
MatchCollection mc = rg.Matches(text);
foreach (var item in mc)
{
if (!FriterList.Contains(item.ToString()))
FriterList.Add(item.ToString());
}
}
return FriterList;
}
附带关键字过滤文件https://files.cnblogs.com/linyijia/%E5%85%B3%E9%94%AE%E5%AD%97.rar