Not a member? Signup now
/** Declaration */ const digitValue = this.$identitynumber.val() as string; const digitRegex = new RegExp('^[0-9]*$'); const validDigit = digitRegex.test(digitValue); /** Usage */ if (validDigit) { true => match } else { no match };