regex giver ingen ting
Hvorfor kan jeg ikke få noget ud af den her function ?Har prøvet med sUrl0 ,sUrl1, sUrl2 og sUrl3 bare for at se om det kom et eller andet..
Private Function ParseKeywords(ByVal strHtml As String)
Dim strReturn As String = ""
Dim Keywords As String = ""
Dim strRegex As String = "<META[^>]+(name=""keywords""|content=""([^""]*)"")[^>]+(name=""keywords""|content=""([^""]*)"")[^>]*>"
Dim HrefRegex As New Regex(strRegex)
Dim HrefMatch As Match = HrefRegex.Match(strHtml)
While HrefMatch.Success = True
'loop through the matches
Dim sUrl0 As String = HrefMatch.Groups(0).Value
Dim sUrl1 As String = HrefMatch.Groups(1).Value
Dim sUrl2 As String = HrefMatch.Groups(2).Value
Dim sUrl3 As String = HrefMatch.Groups(3).Value
Keywords = sUrl3
Keywords = Mid(Keywords, InStr(1, Keywords, "content=""", vbTextCompare) + 9)
Keywords = Mid(Keywords, 1, InStr(1, Keywords, """", vbTextCompare) - 1)
strReturn = sUrl0 & sUrl1 & sUrl2 & sUrl3 & "<---"
HrefMatch = HrefMatch.NextMatch
End While
Return strReturn
End Function