Hi all,
This is my solution,
let quoteSample = "The five boxing wizards jump quickly.";
let nonAlphabetRegex = /\W/g; // Change this line
let result = quoteSample.match(nonAlphabetRegex).length;
What I don’t understand is the counting of the special characters. All I see in the above sample is three special characters and the same with the other tests. I don’t see where are the six special characters.
Thank you in advance for your explanation.
Here are the requirements for the test:
Passed
Your regex should find 6 non-alphanumeric characters in “The five boxing wizards jump quickly.”.
Passed
Your regex should use the shorthand character to match characters which are non-alphanumeric.
Passed
Your regex should find 8 non-alphanumeric characters in “Pack my box with five dozen liquor jugs.”
Passed
Your regex should find 6 non-alphanumeric characters in “How vexingly quick daft zebras jump!”
Passed
Your regex should find 12 non-alphanumeric characters in “123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.”