title: VB.NET Regex Match on XML data
body: <p>I'm trying to get a match against XML data as string for a specific id and a name from a listbox.</p>
  
  <pre><code>Private Sub Button2_Click(sender As Object, e As EventArgs) Handles  Button2.Click
      'website
      Dim link As String = "https://s25-pt.ogame.gameforge.com/api/players.xml"
  
      Dim html As String
      'name selected on listbox
      Dim jogador As String = ListBox1.Text
      Dim pattern As String = "player id=""(.*?)"" name=""" &amp; jogador &amp; """"
  
  
      webc1 = New WebClient
      webc1.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3")
  
      html = webc1.DownloadString(link)
  
  
      Dim match As Match = Regex.Match(html, pattern)
  
      If match.Success Then
          MsgBox(match.Groups(1).Value)
      End If
  End Sub
  </code></pre>
  
  <p>I'm not getting just the id but also I get a big piece of the 'html' string. </p>
  
  <p>I tried to look for answer's on google, I tried other patterns but i don't get how to solve this problem. Is there a way I can improve my regex ?</p>
  
  <p>I know this is xml, and I probably could get it using other method more appropriate, but i find this way easier. </p>