Hey, I got problem with parsing text with regex.
PHP Code:Private Function Get_HTMLTag(ByVal TagName As String, ByVal HTML As String) As List(Of String)
Dim lMatch As New List(Of String) 'Get the results in a List of strings
'RegexOptions.IgnoreCase allows case mismatch e.g. if TagName="title" results can include "title", "Title", "TITLE" etc.
'RegexOptions.Singleline allows .* to see past CarriageReturn characters
Dim Tag As New Regex("(?<=" & TagName & ">).*(?=<\/" & "a></td></tr></table" & ">)", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
For Each rMatch As Match In Tag.Matches(HTML)
lMatch.Add(rMatch.Value)
Next
Return lMatch
End Function
Im trying to parse google.com/trends to one list, but Im getting this:PHP Code:Dim webClient As New WebClient
Dim strings As String
strings = webClient.DownloadString("http://google.com/trends")
Dim Tags As List(Of String) = Get_HTMLTag("sa=X", strings)
webClient.Dispose()
'You can loop through the list to view all of the results
For Each Tag As String In Tags
MsgBox(Tag)
Next
first hot search + source beetween them + last hot search.
But I want all hot searches to one list without source beetween them.




Reply With Quote