title: Parsing Links and Receiving Extra Blanks
body: <p>I am parsing a webpage for http links by first parsing out all the anchored tags, then parsing out the href tags, then running a regex to remove all tags that aren't independent links (like href="/img/link.php"). The following code works correctly, but also appends lots of blank lines in between the parsed links. </p>
  
  <pre><code>while (parse.ParseNext("a", out tag))
  {
      string value;
      //A REGEX value, this one finds proper http address'
      Regex regexObj = new Regex(@"^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$");
      if (tag.Attributes.TryGetValue("href", out value))
      {
          string value2;
          //Start finding matches...
          Match matchResults = regexObj.Match(value);
          value2 = matchResults.Value;
              lstPages.AppendText(value2 + "\r\n");                        
      }
  }
  </code></pre>
  
  <p>To fix this, I added the following code and it works to clean up the list:</p>
  
  <pre><code>if (value2 != "")
  {
      lstPages.AppendText(value2 + "\r\n");
  }
  </code></pre>
  
  <p>However, I</p>
  
  <ol>
  <li>Don't believe this is the most efficient way to go about this and</li>
  <li>Still don't understand where the <code>!= ""</code> lines come from. </li>
  </ol>
  
  <p>My actual question is on both of these but more for issue #2, as I would like to learn why I receive these results, but also if there is a more efficient method for this. </p>