Regex for IP?

Xee

Member
Joined
Apr 6, 2003
Messages
10
Quick question. I am totally new to regular expressions and it seems every tutorial on the net tells me something different. So I was just wondering if someone would help get me started. Heres the html Ill be parsing:


<tr bgcolor="#f9f9f0" align="center" class="punkt">
<td align="left" height=17>163.28.3.5</td>
<td height=17>3128</td>
<td>transparent</td>
<td>Taiwan</td>
<td>10.10.2003</td>
<td><a href="/cgi-bin/whois.cgi?domain=163.28.3.5" target="_blank"><b>Whois</b></a></td>
</tr>
<tr bgcolor="#f9f9f0" align="center" class="punkt">
<td align="left" height=17>81.40.92.255</td>
<td height=17>80</td>
<td>transparent</td>
<td>Spain</td>
<td>10.10.2003</td>
<td><a href="/cgi-bin/whois.cgi?domain=81.40.92.255" target="_blank"><b>Whois</b></a></td>

. . . .

I want to extract the following values (ip, port, anonymity rating, country). Right now, I was just wondering if anyone could help with the IP (Im coding in VisualBasic.NET) . What I came up with was:

[VB]
Dim reg As New Regex("<td align=:Pileft:Pf height=17>(<IP>(:d+)\.(:d+)\.(:d+)\.(:d+))")
[/VB]

But obviously thats wrong (tried it in a Regex evaluator). Anyone? Itd be much appreciated.
 
n/m Found a site that had the regex. Here it is in case anyone wants it:

[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}
 
Back
Top