string regexStrIp4 = @"^(((2[0-4]\d|25[0-5]|[01]?\d\d?).){3}(2[0-4]\d|25[0-5]|[01]?\d\d?))$";
// 第一位为0的情况
string regexStrIp4Add1 = @"^(((2[0-4]\d|25[0-5]|[01]?\d\d?).){3}0)$";
string regexStrIp4Add2 = @"^(((2[0-4]\d|25[0-5]|[01]?\d\d?).){2}0.(2[0-4]\d|25[0-5]|[01]?\d\d?))$";
string regexStrIp4Add3 = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?).0.(2[0-4]\d|25[0-5]|[01]?\d\d?).(2[0-4]\d|25[0-5]|[01]?\d\d?))$";
string regexStrIp4Add4 = @"^(0.(2[0-4]\d|25[0-5]|[01]?\d\d?).(2[0-4]\d|25[0-5]|[01]?\d\d?).(2[0-4]\d|25[0-5]|[01]?\d\d?))$";
Console.WriteLine("请输入一个IP地址:");
string inputStrIp4 = Console.ReadLine();