Hi Guys,

I can't seem to see a solution to this problem, i have this function:

vb.net Code:
  1. Function functionDisplayLoggedInAccountData(ByVal HTML As String)
  2.  
  3.         Dim testStr As String = HTML
  4.         Dim startAt As Integer = 0
  5.         Dim lastIndex As Integer = 0
  6.  
  7.         Do
  8.  
  9.             lastIndex = startAt
  10.  
  11.             '// The first apttern we are looking for
  12.             Dim rx As New Regex("<tr bgcolor=""lightgreen"">")
  13.  
  14.             startAt = rx.Match(testStr, startAt).Index + 28
  15.  
  16.             If startAt < lastIndex Then Exit Do
  17.  
  18.             '// The second pattern we are looking for
  19.             rx = New Regex("(?<=<td nowrap>).*(?=</td>)")
  20.  
  21.             '// The third pattern we are looking for
  22.             Dim rxNew = New Regex("(?<=<td>).*(?=</td>)")
  23.  
  24.             Dim postIDNumber As Integer = rxNew.Matches(testStr, startAt).Item(0).Value
  25.  
  26.             With formMain.mainListView.Items.Add(rx.Matches(testStr, startAt).Item(0).Value)
  27.                 .SubItems.Add(rx.Matches(testStr, startAt).Item(1).Value)
  28.                 .SubItems.Add(rx.Matches(testStr, startAt).Item(2).Value)
  29.  
  30.                 '// Do some string manipulation
  31.                 Dim newString As String = rx.Matches(testStr, startAt).Item(3).Value.Replace("<a href=""/post/shwpst?pii=" & (postIDNumber) & "&amp;db=lv"">", "")
  32.                 Dim finalString As String = newString.Replace("</a>", "")
  33.  
  34.                 .SubItems.Add(finalString)
  35.  
  36.                 '// Colour the background
  37.                 .BackColor = Color.PaleGreen
  38.  
  39.             End With
  40.  
  41.         Loop
  42.  
  43.         Return True
  44.  
  45.     End Function

Which works well, but there are 2 more html fields called:

td bgcolor="lightblue"
td bgcolor="lightgrey"


In my code i just look for the bgcolor="lightgreen" field, is there a way i can get all colours and display the listview background colour accordingly?

thanks guys

Graham