u.changIp = function(e){
if (e.value = e.value.replace(/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?
\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/,"")) {
return;
}else {
//
}
verify whether the ip address is valid
Thecode is like this, but it can not be verified successfully. After trying to create new RegExp (), it still seems to have no effect, but I use this method to verify that it will take effect when only numbers are allowed to be entered. The code for verifying input numbers: e.value = e.value.replace (/ DGG); however, putting this rule on the background can verify it successfully
. @Pattern(regexp="^$|((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)",message="")
what is the reason, please? No error is reported. It is the
bound to the oninput event.related codes
u.changeNub = function(e){
//
if (e.value = e.value.replace(/\D/g,"")) {
return;
}else {
api.toast({
msg: "",
duration: 2000,
location: "bottom"
});
}
}
//ip
if (e.value = e.value.replace(/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/,""))