none
help me regex vb.net RRS feed

  • Question

  • i want  extrect text from html 

     <meta property="uk:scan:tag" content="any text here">
    

    i use the code but not work

         MsgBox(System.Text.RegularExpressions.Regex.Match(RichTextBox1.Text, "(?<=\"">).*?(?=\<\<meta content=)").ToString)


    Saturday, August 24, 2019 9:54 AM

Answers

  • Hi,
    try this Regex:

        Private str As String = "<meta property=""uk:scan:tag"" content=""any text here"">"
    
        Friend Sub Execute()
          Console.WriteLine(str)
    
          Dim reg As New Regex("(?<=content=\"")[^\""]*(?=\"")")
    
          Dim res = reg.Matches(str)
          For Each item In res
            Console.WriteLine(item)
          Next
        End Sub


    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Sunday, August 25, 2019 3:15 AM