简体   繁体   中英

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.

<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

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/*

Beware that this won't be limited to only anchor tags though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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