有一对<td></td>中的内容动态变化,如何用正则取值:有变价时显示为:
<td>
<span style=" text-decoration: underline; font-weight:bold; color:#0000FF">有变价</span>
</td>
像上面这种时取出“有变价”
没变价时显示为:
<td>
<span class=salePrice>2300.0</span><br>
<span class=balPrice> 2000.0</span><br>
</td>
像上面这种时取出"2300.0"和"2000.0"
<td>
<span style=" text-decoration: underline; font-weight:bold; color:#0000FF">有变价</span>
</td>
像上面这种时取出“有变价”
没变价时显示为:
<td>
<span class=salePrice>2300.0</span><br>
<span class=balPrice> 2000.0</span><br>
</td>
像上面这种时取出"2300.0"和"2000.0"
解决方案 »
- c#调用ocx时传递指针的问题
- 请问下屏幕的宽度???
- vs2005里怎么把在datagridview里获取当前行
- 求开发手机Wap页面有什么好用的开发工具和参考资料
- 无标题窗口的拖放怎么实现?
- 请问有谁知道visual studio 2005中的水晶报表是哪个版本的?
- 网站的统计 找个实例看看啊!!!!!!!!!!!!!!!!!
- 如何回收DataSet中的数据?
- tcp传文件,接收失败的问题
- 高级问题:给SqlCommand.Parameters传递多于一个参数时无效
- 光标离开dataGridView中的一列后怎么写方法?
- 我在dataGridView输入数据,输入最后一条数据后,点保存,为什么无效?
string sSource = @"<td>
<span class=salePrice>2300.0 </span> <br>
<span class=balPrice> 2000.0 </span> <br>
</td> ";
MatchCollection mc = Regex.Matches(sSource, @"<span.*?>(.*?)</span>", RegexOptions.IgnoreCase | RegexOptions.Singleline);
foreach (Match m in mc)
{
Console.WriteLine(m.Groups[1].Value.Trim());
}
Console.ReadLine();