paradoxdetected
Programmer
Hi guys!
New guy here, long time lurker, first time actual joiner-and poster.
I'm having a particularly fun time in VB 2008.
I'm trying to return an array (that I can For/Each through) of URLs in an HTML file.
To claify, I want (preferably using regular expressions)to download all the images from a 'Google images' searchpage.
I have the following code that I've been fighting for over a week, can anyone tell me where I'm going wrong?
-----------------------------
Dim myRegex As New System.Text.RegularExpressions.Regex("[\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp)$")
Dim Valid As System.Text.RegularExpressions.MatchCollection
Dim sourcetext As String = wbGoog.DocumentText
MsgBox("source: " + sourcetext)
Valid = System.Text.RegularExpressions.Regex.Matches(sourcetext, "[\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp)$")
For Each match As System.Text.RegularExpressions.Match In Valid
MsgBox(match)
MsgBox("for each initiated!")
Next
-----------------------------
Thank you all for your time, I'm sure I'm doing something stupid here, any - ANY - help would be appreciated
Thanks all!
ParadoxDetected.
New guy here, long time lurker, first time actual joiner-and poster.
I'm having a particularly fun time in VB 2008.
I'm trying to return an array (that I can For/Each through) of URLs in an HTML file.
To claify, I want (preferably using regular expressions)to download all the images from a 'Google images' searchpage.
I have the following code that I've been fighting for over a week, can anyone tell me where I'm going wrong?
-----------------------------
Dim myRegex As New System.Text.RegularExpressions.Regex("[\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp)$")
Dim Valid As System.Text.RegularExpressions.MatchCollection
Dim sourcetext As String = wbGoog.DocumentText
MsgBox("source: " + sourcetext)
Valid = System.Text.RegularExpressions.Regex.Matches(sourcetext, "[\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp)$")
For Each match As System.Text.RegularExpressions.Match In Valid
MsgBox(match)
MsgBox("for each initiated!")
Next
-----------------------------
Thank you all for your time, I'm sure I'm doing something stupid here, any - ANY - help would be appreciated
Thanks all!
ParadoxDetected.