RegEx for an IP Address

前端 未结 12 1582
不知归路
不知归路 2020-11-29 03:52

I try to extract the value (IP Address) of the wan_ip with this sourcecode: Whats wrong?! I´m sure that the RegEx pattern is correct.

String input = @\"var p         


        
12条回答
  •  情书的邮戳
    2020-11-29 04:41

    Try this:

     Match match = Regex.Match(input, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
     if (match.Success)
     {
         Console.WriteLine(match.Value);
     }
    

提交回复
热议问题