C# IP正则表达式

1 public static bool IsValidIp(string strIn)
2         {
3             bool b = Regex.IsMatch(strIn, @"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$");
4 
5             return b;
6         }

 

posted @ 2018-03-08 16:13  liu_xh  阅读(4228)  评论(2)    收藏  举报