读取到一个网页原码如下:
xxxxxxxxxxx网页内容
<a target="_blank" href="http://www.xxxx.com/asda">立即下载</a>
xxxxxxxxxxx网页内容
请问要怎么样获得herf=""里的连接了?最好是用正则,,.麻烦给代码和说明.....谢谢
xxxxxxxxxxx网页内容
<a target="_blank" href="http://www.xxxx.com/asda">立即下载</a>
xxxxxxxxxxx网页内容
请问要怎么样获得herf=""里的连接了?最好是用正则,,.麻烦给代码和说明.....谢谢
string pattern = "(?i)<a\\s[\\s\\S]*?href=\"([^\"]*)\">立即下载</a>";
string result = Regex.Match(s, pattern).Groups[1].Value; // 你要的结果。。