Regex strategies for htm tags - Getting strings inside html source code

thugster69

Active member
Joined
Jun 17, 2010
Messages
35
Programming Experience
Beginner
Hi Folks,

First of all, I would like to say that finally, I'm back to this wonderful site! I've taken a break from programming since my work doesn't require it.

For my query, what I'm trying to do is get a string from a group of html tags. I've successfully coded my initial logic for "IM tickets". Long story short, here's the code:
VB.NET:
'Original HTML structure = Current Status:</span></td><td><span class=f> [I]SOME TEXT[/I]
        Dim FRRegex As New Regex("Current Status:</span></td><td><span class=""f""> .*[/B]") ' the .* represents the text to be fetched
        Dim FRmatches As MatchCollection = FRRegex.Matches(rsresourceCode)

        For Each itemCode As Match In FRmatches
            addedString = itemCode.Value.Split("""").GetValue(2)
            ListBox1.Items.Add(addedString.Trim(">"))
            MsgBox(addedString)
        Next

While when coding for another format, I can't seem to make it work:
VB.NET:
        'Original HTML structure  <B>Status  </B></font></td><td bgcolor=#CCCCCC>Fulfilled
        Dim FRRegex As New Regex("<B>Status  </B></font></td><td bgcolor=#CCCCCC>"".*")
        Dim FRmatches As MatchCollection = FRRegex.Matches(rsresourceCode)

I'm having trouble getting strings after the greater than sign. Hope you can help me fix this mess. :)
 
Back
Top