Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Error finding regex matches

$
0
0
Hi, so i have some code that gets the source of a webpage, but i have an issue. I want to get the last link on the page that has an href of:

Quote

/profile.php?puid=<RandomCharactersHere>
So i constructed my regex like such:
                    Dim holster As String = New StreamReader(checkReqRes.GetResponseStream).ReadToEnd

                    If holster.Contains("<a href=""/profile.php?puid=") Then
                        Dim reggy As New Regex("<a href=""/profile.php?puid=.*")
                        Dim matchColl As MatchCollection = reggy.Matches(holster)
                        Dim x As String = ""
                        For Each user As Match In matchColl
                            If user.Value.Contains(generalInfo(2)) Then
                                nextLink = user.Value.Split("""")(1)
                                MsgBox(nextLink)
                            End If
                        Next
                    End If



the issue is that there seem to be no matches in matchColl. So i threw in some breakPoints and i can see that the "If holster.Contains..." statement is workng correctly, but the regex wont seem to pick up on any matches. Can anyone offer a little guidance.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



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