菜单

检查IP是否正确


最后更新:2020-01-11 20:20


简介:
类似192.168.11.1


function f5iFEKUncM(ip) {
    var exp=/^(\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 reg = ip.match(exp);
    if(reg==null){
        return false;
    } else {
        return true;
    }
}
测试