Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 正则表达式模式VB.NET_Regex_Vb.net - Fatal编程技术网

Regex 正则表达式模式VB.NET

Regex 正则表达式模式VB.NET,regex,vb.net,Regex,Vb.net,如何从网站中提取此信息 我知道如何处理web请求,但我无法理解regex模式 我想用一个链接下载一个文件,这个链接在这个html代码中 <a href="#" onclick="downloadStart();window.location='http://url.co.uk/download/2690'"><button type="submit" class="css3button" value="download">Download</button>&l

如何从网站中提取此信息

我知道如何处理web请求,但我无法理解regex模式

我想用一个链接下载一个文件,这个链接在这个html代码中

<a href="#" onclick="downloadStart();window.location='http://url.co.uk/download/2690'"><button type="submit" class="css3button" value="download">Download</button></a>

这是我想要的url
http://url.co.uk/download/2690


谢谢你的帮助,非常感谢

您可以尝试以下正则表达式:

http://url.co.uk/download/[^'”\s]+?(?=['”\s])

这将从页面中提取所有URL,这些URL是fomat:
http://url.co.uk/download/*


注意,这将不仅仅局限于锚定标签

对于解析html,使用html解析器可能比使用正则表达式更容易。Html是不规则的,但即使这样,我也不知道从哪里开始。我不想被填鸭式的喂养,但我不擅长正则表达式模式。尝试了很多次。如果它的结尾总是有一个双引号,那么您所需要做的就是将子字符串添加到双引号的索引中。可以帮助