Code
自己项目里写的过滤
关键字的正则是
(关键字1|关键字2|关键字3.。。。)
Regex regex = = new Regex("");//要过滤的正则表达式
string result = regex.Replace(source, new MatchEvaluator(MatchHelper.CapText));
public static class MatchHelper
{
public static string CapText(Match m)
{
// Get the matched string.
string matchString = m.ToString();
matchString = "<span style='color:red;'>" + matchString + "</span>";
return matchString;
}
}