<a href="htm_data/16/1310/579533.html" id="a_ajax_579533" target=_blank>我是逗逗</a> <a href="htm_data/16/1310/2334(这个数字可变,希望提取出来).html" id="a_ajax_2334(这个数字可变,和前面的那个数字相同)" target=_blank>大小事儿全包</a> <a href="htm_data/16/1310/993840.html" id="a_ajax_993840" target=_blank>我是小米</a>
htm_data/16/1310/之后的数字是变的。其他都是不变的。需要提取:我是逗逗
大小事儿全包了。
我是小米和前面的那个可变数字
我用的是:
foreach (Match m in Regex.Matches(zifuchuan, "正则")
{
myRow["ID"] = m.Groups["bcontent"].Value;
myRow["文章标题"] = m.Groups["divcontent"].Value;
}
htm_data/16/1310/之后的数字是变的。其他都是不变的。需要提取:我是逗逗
大小事儿全包了。
我是小米和前面的那个可变数字
我用的是:
foreach (Match m in Regex.Matches(zifuchuan, "正则")
{
myRow["ID"] = m.Groups["bcontent"].Value;
myRow["文章标题"] = m.Groups["divcontent"].Value;
}
{
myRow["ID"] = m.Groups[1].Value;
myRow["文章标题"] = m.Groups[2].Value;
}
{
myRow["ID"] = m.Groups[1].Value;
myRow["文章标题"] = m.Groups[2].Value;
}