Match Single Character with Multiple Possibilities

Match Single Character with Multiple Possibilities
0.0 0

#1

Tell us what’s happening:

Your code so far


let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/ig; // Change this line
let result = vowelRegex.test(quoteSample); // Change this line

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-single-character-with-multiple-possibilities/


#2

Hi,
The RegExp test() method will not help you here - it only returns true or false.

There is a String method to get matches to a regular expression though.


#3

I don’t know why, but mine isn’t working at all… See below.


#4

i added the additional code to see if I could get it to work, but it wouldn’t go.


#5

i thing you should use the match method with the quoteSample string not with VowelRegex, then it should work.