用正则表达式提取ip地址分段?
例如:
dim strIP,strNewIP
strIP = "192.168.0.10 "
用正则表达式提取后:
strNewIP = "192.168 " 或
strNewIP = "192.168.0 "
谁给写个正则表达式
------解决方案-------------------- <%
IP = Request.servervariables( "REMOTE_ADDR ")
'response.write ip
arry=split(IP, ". ")
for i=0 to ubound(arry)-2 ' '或者减二,看你想要什么样的效果...
if str= " " then
str=arry(i)
else
str=str& ". "&arry(i)
end if
next
response.write str
%>