Posted on
2008-08-28 16:13
Yruigood
阅读(
937)
评论()
收藏
举报
![]()
Code
string strRegex = @"<a.+?a>";
Regex regex;
MatchCollection matchCollection;
regex = new Regex(strRegex, RegexOptions.IgnoreCase);
matchCollection = regex.Matches(strHTML);
for (int i = 0; i < matchCollection.Count; i++)
{
//用数组保存取得的A标签;
string[] strArray = MemoryTitleUrl(matchCollection[i].Value);
}
//其中strHTML是包含众多A标签的string串
//记得引用using System.Text.RegularExpressions;