正则表达式 完成.请求帮助
本帖最后由 zhao_ming 于 2012-11-10 18:43 编辑<TR>
<TD>50.22.206.179
<SCRIPT type=text/javascript>document.write(":"+r+d)</SCRIPT>
:80</TD>
<TD>HTTP</TD>
<TD>437,921,921</TD>
<TD>SoftLayer Tech., Dallas, Texas, US</TD></TR>
<TR>
<TD>202.152.12.77
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>359,1297,1297</TD>
<TD>Indonesia</TD></TR>
<TR>
<TD>202.162.198.178
<SCRIPT type=text/javascript>document.write(":"+r+d+d+d)</SCRIPT>
:8000</TD>
<TD>HTTP</TD>
<TD>218,1875,1875</TD>
<TD>Indonesia</TD></TR>
<TR>
<TD>202.171.253.98
<SCRIPT type=text/javascript>document.write(":"+r+d)</SCRIPT>
:80</TD>
<TD>HTTP</TD>
<TD>62,1640,1640</TD>
<TD>澳门 Macauweb公司</TD></TR>
<TR>
<TD>203.172.188.34
<SCRIPT type=text/javascript>document.write(":"+r+d)</SCRIPT>
:80</TD>
<TD>HTTP</TD>
<TD>344,1797,1797</TD>
<TD>Thailand</TD></TR>
<TR>
<TD>210.4.73.82
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>391,1891,1891</TD>
<TD>孟加拉</TD></TR>
<TR>
<TD>210.101.131.232
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>125,1469,1469</TD>
<TD>Seoul, Korea</TD></TR>
<TR>
<TD>216.244.71.143
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>235,1125,1125</TD>
<TD>美国 加利福尼亚州洛杉矶Wowrack科技公司</TD></TR>
<TR>
<TD>219.75.27.11
<SCRIPT type=text/javascript>document.write(":"+r+d)</SCRIPT>
:80</TD>
<TD>HTTP</TD>
<TD>344,1937,1937</TD>
<TD>新加坡 电信SINGNET</TD></TR>
<TR>
<TD>222.124.35.117
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>328,1641,1688</TD>
<TD>Indonesia</TD></TR>
<TR>
<TD>222.124.147.105
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>266,1219,1219</TD>
<TD>Indonesia</TD></TR>
<TR>
<TD>88.85.108.16
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>343,2422,2422</TD>
<TD>马其顿</TD></TR>
<TR>
<TD>89.251.103.130
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>375,2422,2422</TD>
<TD>Russia</TD></TR>
<TR>
<TD>93.91.55.65
<SCRIPT type=text/javascript>document.write(":"+r+d+r+d)</SCRIPT>
:8080</TD>
<TD>HTTP</TD>
<TD>641,2328,2328</TD>
<TD>捷克</TD></TR></TBODY></TABLE></DIV>
<DIV class=proxylistnav>
<UL>
想要的结果
50.22.206.179:80 不懂这东东,帮你顶下 回复 1# zhao_ming
你不是已经匹配出了?? 本帖最后由 zhao_ming 于 2012-11-10 19:10 编辑
回复 3# annybaby
<TR>
<TD>50.22.206.179
<SCRIPT type=text/javascript>document.write(":"+r+d)</SCRIPT>
:80</TD>
只取得了 50.22.206.179 后面的:80没取出来... 回复 4# zhao_ming
先用正则删除掉ip与端口之间的无用字符,再匹配
标题
回复 4# zhao_ming先用正则删除掉ip与端口之间的无用字符,再匹配 本帖最后由 user3000 于 2012-11-10 21:48 编辑
(可以考虑同时分组捕获ip及端口:)
刚才发的有误,下面是经过调试的.
$str = ClipGet()
$a = StringRegExp($str, '(?msi)<td>(\d+\.\d+\.\d+\.\d+).+?(:\d+)</td>', 3)
_ArrayDisplay($a) ((((?<=>)|\.)\d+){4})[\s\S]+?(:\d+)(?=</td) TD\>([\d\.]+)\v+\V+\v+(:[\d]+(?=<\/TD>))
页:
[1]