62,046
社区成员
发帖
与我相关
我的任务
分享
//不知道mailto:andy@email.com这里的email要替换不!
//如果要替换的话把[^@]去掉就可以
string str = "<a title=\"email\" href=\"mailto:andy@email.com\">send email to andy (mailto:andy@email.com)</a>";
Regex reg = new Regex(@"(?<=>[^<]*?)([^@]email)(?=[^>]*?<)");
string result = reg.Replace(str, delegate(Match m) { return m.Value.Replace("email", "<font color='red'>email</font>"); });
Response.Write(result);