获取xml中所有某标签的内容

string regStr = "<A>([\\w\\W]+?)</A>";//匹配A标签正则表达式
Regex tmpReg = new Regex(regStr, RegexOptions.Compiled);
MatchCollection matcheList = tmpReg.Matches(xml);
if (matcheList.Count != 0)
{
 for (int i = 0; i < matcheList.Count; i++)
  {
       list.Add(matcheList[i].Groups[0].Value);
  }
}

 

posted @ 2017-03-31 15:00  米斯特唐  阅读(1499)  评论(0)    收藏  举报