日期:2014-05-18 浏览次数:20816 次
private static string RegExprEmail = @"(mailto\:|contact\=)?(?<1>[^\@\s]{1,}\@(?:[^\s\.]{1,}\.){1,}(?:[a-z]{2,4}\.?){1,2})"; private static Regex RegExFindEmail = new Regex(RegExprEmail,RegexOptions.IgnoreCase|RegexOptions.Multiline); E_Mail email = new E_Mail();//自己定义的E_Mail类 for (Match n = RegExFindEmail.Match(html); n.Success; n = n.NextMatch()) { email.Email = n.Groups["1"].Value.Trim(); email.Mark = false; if (!Email_Exist(email.Email)) { email.Url = father_url.Get_url_link().ToString(); for (int i = 0; i < Common.KeyWord.Length; i++) { if (html.Contains(Common.KeyWord[i])) { email.Mark = true; break; } } Common.Email_List.Add(email);//这个是一个类public static IList<E_Mail> Email_List=new List<E_Mail>(); }