1. 程式人生 > >js ip地址的校驗

js ip地址的校驗

今年企業對Java開發的市場需求,你看懂了嗎? >>>   

// ip格式校驗
export const regIp = (ip) =>{
    var str =/^(\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])$/;
    retu