Not a member? Signup now
Be assumption that format is: 92064-5617 or 92064 const zipCodeRex = /(^$)|(^\d{5}$)|(^\d{5}-\d{4}$)/; if (this.zipCodeRex.test(zipCodeVal)) { // Valid } else { // Invalid }