title: vb2008 match text between html tags
body: <p>hello i'm using <code>Visual Basic 2008 Express Edition</code></p>
  
  <p>how is it possible to match text between tags?</p>
  
  <p>for example i have a string : <code>&lt;data&gt;Text&lt;/data&gt;more text...</code>, how i can get the <code>Text</code> which is inside <code>&lt;data&gt;&lt;/data&gt;</code> ( <strong>.Replace</strong> won't help).</p>
  
  <p>thanks</p>
  
  <p><strong>My solution :</strong></p>
  
  <pre><code>    Public Function parseText(ByVal str As String, ByVal tag As String) As String
          Dim match As Match = Regex.Match(str, "&lt;" &amp; tag &amp; "\b[^&gt;]*&gt;(.*?)&lt;/" &amp; tag &amp; "&gt;")
          If match.Groups.Count = 2 Then
              Return match.Groups(1).Value
          Else
              Return "0"
          End If
      End Function
  </code></pre>
  
  <p>I use this because in my case the tags will be always without <code>id, class, width, href, src, style ....</code> just tag name (<code>ex:&lt;data&gt;&lt;str&gt;&lt;text&gt;...</code>)</p>