我得到一个页面代码,其中包含这样的部分:
marker.server = '81.30.178.138';
marker.number = '001-999-141';
marker.token = 'b402e62ca6934e00919045e1da2f0fb9';
有没有办法将IP和令牌切换为两个String变量,通过相同的中间位置找到它们 - marker.number? 我既不是VBS,也不是正常的......请帮忙。
答案 0 :(得分:0)
如果您要提取IP地址,请查看以下代码:
Option Explicit
Dim Title,Data
Title = "IP Public Adress"
Data = "marker.server = '81.30.178.138';"&_
"marker.number = '001-999-141';"&_
"marker.token = 'b402e62ca6934e00919045e1da2f0fb9';"
MsgBox "My IP Public Adress is : " & vbCr & Extract_IP_Public(Data),64,Title
'**************************************************************
Function Extract_IP_Public(Data)
Dim objRegex,Match,Matches
Set objRegex = new RegExp
objRegex.Pattern = "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
objRegex.Global = False
objRegex.IgnoreCase = True
Set Matches = objRegex.Execute(Data)
For Each Match in Matches
Extract_IP_Public = Match.Value
Next
End Function
'**************************************************************