hello, i am on the hard part of regex.
what i am trying to do is extract information beween two tags in some html from the source of a website.
The contents of the text between the two tags will always be different.
the code i currently have is;
this is code i have adapted, so im not sure if its correct. The problem is, when it gets to while m.success, it skips the suction, meaning it didnt work.Code:Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim html As String = WebBrowser1.DocumentText Dim regxheader As String regxheader = HeaderFronttxt.Text & "*\" & HeaderEndtxt.Text Dim r = New Regex((regxheader), _ RegexOptions.IgnoreCase) Dim m As Match = r.Match(html) While m.Success headerDisplaytxt.Text = m.Value End While End Sub
The code i am trying to extract is
the two text box entries for the VB code at the top is <h2> and </h2>Code:<h2> Sony 2.1 35W PC Speakers </h2>




Reply With Quote