Match Single Character with Multiple Possibilities - you should find all 25 vowels

Tell us what’s happening:
I couldn’t pass the “you should find all 25 vowels” test without modifying the original string. This feels like hacking the exercise, but I think the test is wrong. I counted the characters returned and counted 26 characters returned. Please let me know if I failed to code this excercise correctly or if you think this test needs to be modified to be true with 26 characters.

Your code so far


let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried t.";
let vowelRegex = /[a,e,i,o,u]/gi; // Change this line
let result = quoteSample.match(vowelRegex); // Change this line
console.log(result); 
console.log(result.length);


Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities

Look at the sample code. Compare with your your code.

       some silly mistake their.
1 Like

That’s not the correct syntax for ranges in regular expressions.

1 Like

Thanks! I won’t forget that syntax now.