This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************** POSTAL CODE *****************/ | |
// cannot start with a zero and must contain 5 digits. | |
let postalCode = "12345"; | |
let regexPostalCode = new RegExp("^[1-9][0-9]{4}$"); | |
let postalCodeMathces = postalcode.match(regexPostalCode); | |
console.log('POSTAL CODE MATCHES:', postalCodeMathces !== null); | |
/***************** PERSONAL NUMBER *****************/ | |
// can only start with one or two | |
// second character can only be a nine or zero |