Content deleted Content added
add range calculation tools |
improved IPv6 regex |
||
Line 269:
function extractIP(userName) {
const IPV4REGEX = /^((?:1?\d\d?|2[0-2]\d)\b(?:\.(?:1?\d\d?|2[0-4]\d|25[0-5])){3})(?:\/(1[6-9]|2\d|3[0-2]))?$/;
const IPV6REGEX = /^((?:[\dA-Fa-f]{1,4}:){
const match = IPV4REGEX.exec(userName) || IPV6REGEX.exec(userName);
if (match) {
|