Match All Letters and Numbers

Match All Letters and Numbers
0.0 0

#1

Tell us what’s happening:

Your code so far


let quoteSample = "The five boxing wizards jump quickly.";
let alphabetRegexV2 = /\w+/gi; // Change this line
let result = quoteSample.match(alphabetRegexV2).length;

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers


#2

Close but you are not matching individual characters but whole words.

If you have time take your regex for a test drive on https://regexr.com/


#3

Your regex will match all “clusters” of alphanumeric characters. For example, in the first test case

Your regex should find 31 alphanumeric characters in "The five boxing wizards jump quickly."

Your regex will not match individual characters, but rather count the alphanumeric clusters: The, five, boxing, wizards, jump, quickly.

See this link: https://regex101.com/r/FS9KSe/1
Play around with removing and retyping the + symbol and compare the results.


#4

just came across this challenge. thank you guys for the explanation!