private function checkIPV4(ipAddress:String):Boolean {
var ipRegExp:RegExp =/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
return ipRegExp.exec(ipAddress);
}
方式1 可验证带*的模糊字段 如:192.168.*.9 或者 192.*.1.12 [Bindable] public var ip1:RegExp =/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(
))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))$/; 方式2 不带任何模糊验证 192.168.1.12 [Bindable] public var ip2:RegExp =/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
var ipRegExp:RegExp =/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
return ipRegExp.exec(ipAddress);
}
方式1 可验证带*的模糊字段 如:192.168.*.9 或者 192.*.1.12 [Bindable] public var ip1:RegExp =/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(
))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))\.((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([*]))$/; 方式2 不带任何模糊验证 192.168.1.12 [Bindable] public var ip2:RegExp =/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;