简体   繁体   English

正则表达式模式 VB.NET

[英]Regex pattern VB.NET

How can i extract this from a website?我怎样才能从网站上提取这个?

I know how to do web requests I just cant get my head around the regex pattern.我知道如何处理网络请求,但我无法理解正则表达式模式。

I want to download a file using a link and that link is in this html code.我想使用链接下载文件,该链接位于此 html 代码中。

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

This is the url I want http://url.co.uk/download/2690这是我想要的网址http://url.co.uk/download/2690

Thank you any help is very grateful.谢谢任何帮助非常感谢。

You can try this regex:你可以试试这个正则表达式:

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

This will extract all urls from the page which are the fomat: http://url.co.uk/download/*这将从作为格式的页面中提取所有网址: http://url.co.uk/download/* : http://url.co.uk/download/*

Beware that this won't be limited to only anchor tags though.请注意,这不仅限于锚标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM