日期:2014-05-17 浏览次数:20514 次
string keywords = "aabb"; string tempStr = "aaBbccdsfdsfaAbbsdAABbf"; string pattern = @"(?i)"+keywords; tempStr = Regex.Replace(tempStr,pattern,"<span style='color:red'>$0</span>"); //<span style='color:red'>aaBb</span>ccdsfdsf<span style='color:red'>aAbb</span>sd<span style='color:red'>AABb</span>f