title: Using regex in Vb.net to extract phone numbers
body: <p>I wrote this code to extract mobile numbers from web link
  basically i got three links in list box and getting its source code using the code below
  now while i'm trying to use RegEx to Extract Phone Number but i'm getting same number again and again.
  This is full code which i wrote! and the website from i'm extracting link is</p>
  
  <p><a href="http://bolee.com/nf/all-results" rel="nofollow">http://bolee.com/nf/all-results</a></p>
  
  <pre><code>Dim doc As New HtmlAgilityPack.HtmlDocument()
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      If ListBox1.Items.Count = 0 Then
          MsgBox("Please Extract Links First")
      Else
          ListBox1.SelectedIndex = 0
      End If
  End Sub
  
  Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      ScrapLinks()
  End Sub
  
  
  
  Private Function ScrapLinks()
      Dim hw As New HtmlWeb()
      Try
          doc = hw.Load(TextBox1.Text)
          doc.LoadHtml(doc.DocumentNode.SelectSingleNode("//*[@id='ad_list']").InnerHtml())
  
          For Each link As HtmlNode In doc.DocumentNode.SelectNodes("//a[@href]")
  
              Dim hrefValue As String = link.GetAttributeValue("href", String.Empty)
  
              If hrefValue.Contains("/detail/") Then
                  ListBox1.Items.Add(hrefValue)
              End If
          Next
  
          Dim items(ListBox1.Items.Count - 1) As Object
          ListBox1.Items.CopyTo(items, 0)
          ListBox1.Items.Clear()
          ListBox1.Items.AddRange(items.AsEnumerable().Distinct().ToArray())
          lbllinks.Text = ListBox1.Items.Count
  
      Catch ex As Exception
          MsgBox("Error " + ex.Message)
  
      End Try
      Return Nothing
  
  End Function
  Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
          Try
          Dim re As New Regex("(\+92|0092)-?\d{3}-?\d{7}|\d{11}|\d{4}-\d{7}")
  
          ' For Each link As String In ListBox1.Items
  
          Dim hw As New HtmlWeb()
          doc = hw.Load(ListBox1.SelectedItem)
          Dim data = doc.DocumentNode.SelectSingleNode("//*[@class='det_ad f_left']").InnerText
  
          '    For Each match As Match In re.Matches(data)
  
          TextBox2.Text = Data
  
  
          '    Next
          'Next
  
      Catch ex As Exception
          MsgBox("Error " + ex.Message)
  
      End Try
  End Sub
  </code></pre>
  
  <p>Here is s sample of out put i'm getting</p>
  
  <p>03152405552
  03152405552
  03152405552
  03152405552
  03152405552
  03152405552</p>