How to extract IP and port Regex

  • Thread starter Thread starter programmervb.net
  • Start date Start date
P

programmervb.net

Guest
How to extract IP and port in this format

167.71.167.227:8080

from html and javascript

<tr><td class="left" style="text-align: center;"><script type="text/javascript">document.write(Base64.decode("MTY3LjcxLjE2Ny4yMjc="))</script>167.71.167.227</td><td><span class="fport">8080</span></td><td><small>HTTP</small></td><td class="left"><div style="padding-"><img class="flag flag-us" alt="United States" src="/flags/blank.gif"> <a href="/en/proxylist/country/US/all/ping/all">United States</a></div></td><td class="small"><small>New York</small></td><td class="small"><small>New York</small></td><td class="small"><small>Anonymous</small></td><td> <small>6253 kB/s</small> <div class="progress"><div class="fill" style="width: 100%; background-color: rgb(165, 218, 116);"></div></div></td><td><small>100%</small><div class="progress"><div class="fill" style="width: 100%; background-color: rgb(165, 218, 116);"></div></div></td><td><div style="padding-"><small>48 ms</small> <div class="progress"><div class="fill" style="width: 99%; background-color: rgb(165, 218, 116);"></div></div></div></td><td><small>6 hours ago</small></td></tr>

i use the code but not work

Dim expression As New System.Text.RegularExpressions.Regex("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}")

Dim mtac As MatchCollection = expression.Matches(RichTextBox1.Text)
For Each itemcode As Match In mtac
ListBox1.Items.Add(itemcode)
Exit For
Next

Continue reading...
 
Back
Top