js regular expression to validate the port range

javascript regular expression to validate the legitimacy of the port IP address (0-65535)

if (!(/^[1-9]\d*$/.test(port) && 1 <= 1 * port && 1 * port <= 65535)){
    return false
}

Tip Copywriter:

Your port does not meet the range: 0-65535

Guess you like

Origin www.cnblogs.com/vipweb/p/12152630.html