Hack Forums
[.NET] Please HELP ME - Regex multiple matches for multiple urls. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Please HELP ME - Regex multiple matches for multiple urls. (/showthread.php?tid=5087446)



Please HELP ME - Regex multiple matches for multiple urls. - FKTHEking - Dec 9, 2015

I want to get certain values from different websites which I have in one file: D:\list.txt

Here is the code that I'm using.

Sub get_names
For Each Line As String In System.IO.File.ReadAllLines(D:\list.txt)
Dim currentsource As String = New System.Net.WebClient().DownloadString(line)
Dim Jolu As String = "(?<=names:"(.*?)(blabla) 'Not here is my problem
Dim ParseNames As MatchCollection = Regex.Matches(currentsource, Jolu)
Next
Next
End Sub

Please help me! It's urgent! 😭


* - BahNahNah - Dec 9, 2015

Loop through the values in Regex.Matches.


* - FKTHEking - Dec 9, 2015

For my shame I don't know how to do this. I searched everywhere to get a way for looping, but I still don't get it. :(


* - BahNahNah - Dec 9, 2015

(Dec 9, 2015 01:42 AM)FKTHEking Wrote:  For my shame I don't know how to do this. I searched everywhere to get a way for looping, but I still don't get it. :(

Does "everywhere" include google?

[Image: chHP4h5.png]


* - Odus - Dec 9, 2015

Your iterator should be of type Match. You can then read (typical) group 1's value.


* - Josh‎ - Dec 9, 2015

You already have a loop for System.IO.File.ReadAllLines