Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27199

VS 2010 RegEx to find link in source

$
0
0
hi

I'm not sure how these work so did some research and did this:
Code:

'Scan the source and find download link
                Dim src As String = WC.DownloadString(url)
                Dim st As String = "http://myurl.com/dl.php?file="
                Dim match As New Regex(st + "+([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
                Dim dl As String = match.Match(src).Value

I no the st var will always be the same but this "+([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?" im not sure works, it's suppposed to matches a file eg:

This_Is_My_AppUpdate.zip

now when testing the dl var in webclient, it says New Uri(dl) is empty, why..........

Viewing all articles
Browse latest Browse all 27199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>