Question: Q9 The regular expression ^d{5}-d{4}|d{5}|[A-Z]d[A-Z] d[A-Z]d$ is designed to validate American ZIP Codes and Canadian Postal Codes but there are two problems with it. What
Q9 The regular expression ^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ is designed to validate American ZIP Codes and Canadian Postal Codes but there are two problems with it. What is one of the flaws? 1) It doesn't allow for leaving the space out after the third character in the Canadian Postal Code. 2) American ZIP codes that start with 0 aren't accepted. 3) It requires that the string contain an American ZIP Code followed by a Canadian Postal Code. 4) It allows for American ZIP codes with 9 digits
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
