HTMLViewer and Regex

I’ve been using HTMLViewer to get the source and then regex to get the elements. This works well except for when the source has spaces and line feeds. Is there a good way to remove the blank lines and trim the spaces off of the end so it’s easier for me to use regex to get the elements. This is a Windows app. Below is my code to populate a textarea(txtSource.Text). Below that is what the source looks like with the blank lines and spaces. It’s difficult to get the "div class=“friend-name” when the innertext is spaced out over the next 4 lines. Any help would be great, thanks.

txtSource.Text = “”
dim b as ChromiumBrowserMBS = HTMLViewer1.ChromiumBrowserMBS
if b<>Nil then
dim m as ChromiumFrameMBS = b.mainFrame
if m<>Nil then
dim t as string = m.Source
txtSource.Text = t
end if
end if


    <td class="runner-name-column">
      <div class="owner-name">Joe Shmo</div>
        <div class="runner-name">Name of Person</div>
      <div class="friend-name">
        Test Data

Off the top of my head:

t = t.ReplaceLineEndings( &uA )
var lines() as string = t.Split( &uA )
for index as integer = lines.LastIndex downto 0
  var thisLine as string = lines( index ).Trim
  if thisLine = "" then
    lines.RemoveAt( index )
    lines( index ) = thisLine
  end if

t = String.FromArray( lines, &uA )

Thanks Kem, it worked great!