string tarIP = srcIP.Substring(0, srcIP.LastIndexOf(".") + 1) + "*";
string[] temp = s.Split(new char[] { '.' });
string tt = temp[0] + "." + temp[1] + "." + temp[2] + ".*";
Console.WriteLine(tt);
string Text = Regex.Replace("196.168.16.23", @"(\d+.\d+.\d+.)(\d+)", "$1*");
Console.WriteLine(Text);
![](http://www.cnblogs.com/Emoticons/yoyocici/224024437.gif)
![](http://www.cnblogs.com/Emoticons/baimantou/223332344.gif)
![](http://www.cnblogs.com/Emoticons/tusiji/203330832.gif)