To finish this challenge, it’s necessary to use character classes.
The \W matches any character that is not a word character from the basic Latin alphabet.
Equivalent to [^A-Za-z0-9]._
/[^A-Za-z0-9_]/ matches “%” in “50%”.
Solution 1 (Click to Show/Hide)
let quoteSample = "The five boxing wizards jump quickly."; let nonAlphabetRegex = /\W/g; // Change this line let result = quoteSample.match(nonAlphabetRegex).length;