addIpToArray() { let newIp = ''; isEmpty(this.mask) ? newIp = this.ip : newIp = this.ip + '/' + this.mask; console.log(newIp) let test = this.regexp.test(newIp) console.log(test) } It is necessary to validate aypishnik with a mask. Returns true, false, true, false. those. at each iteration a different value. What could be the problem? Regular:
/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))?$/g