小编h0s*_*erT的帖子

RegEx的IP地址

我试着用这个源代码提取wan_ip的值(IP地址):怎么回事?!我确定RegEx模式是正确的.

String input = @"var product_pic_fn=;var firmware_ver='20.02.024';var wan_ip='92.75.120.206';if (parent.location.href != window.location.href)";
Regex ip = new Regex(@"[\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
string[] result = ip.Split(input);

foreach (string bla in result)  
{
  Console.WriteLine(bla);                
}

Console.Read();
Run Code Online (Sandbox Code Playgroud)

.net c# regex

38
推荐指数
6
解决办法
6万
查看次数

标签 统计

.net ×1

c# ×1

regex ×1