Regular Expressions: Find More Than the First Match

Regular Expressions: Find More Than the First Match
0

#1

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match

Can’t pass the tests. Keep getting starRegex.match is not a function

let twinkleStar = "Twinkle, twinkle, little star";
let starRegex = /twinkle/gi; // Change this line
let result = starRegex.match(twinkleStar); // Change this line

#2

Look carefully at the example’s syntax. Make sure not to mix up the string vs. the regular expression.


#3

Thanks…took me a minute but got it figured out from the example as you said