Why is it that “gut feeling” is returning “g” if the regex is /go*/ ?
Shouldn’t it least have a “go” (both letters)? or how come it matches if “gut feeling” doesn’t have a “go”, but “gu”. Shouldn’t it return null?
Thanks
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
Challenge: Match Characters that Occur Zero or More Times
Link to the challenge: