Tell us what’s happening:
In the instructions example below why does the gPhrase.match(goRexex); returns [“g”]? Shouldn’t it return null cause the check was for “go”.
let soccerWord = “gooooooooal!”;
let gPhrase = “gut feeling”;
let oPhrase = “over the moon”;
let goRegex = /go*/;
soccerWord.match(goRegex); // Returns [“goooooooo”]
gPhrase.match(goRegex); // Returns [“g”]
oPhrase.match(goRegex); // Returns null
Your code so far
let chewieQuote = "Aaaaaaaaaaaaaaaarrrgh!";
let chewieRegex = /Aa*/;
let result = chewieQuote.match(chewieRegex);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
.
Link to the challenge: