JS常用正则表达式积累
IP地址
Format:192.168.1.1 或 192.168.1.1/24
isGateWayAddress = (ip) => {
var reg = /^(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(\/\d|\/[1-2][0-9]|\/3[0-2])?$/
return reg.test(ip);
}