Find More Than the First Match
Summary
- The
g
flag is used to match a search more than once.
Final Code
let twinkleStar = "Twinkle, twinkle, little star";
let starRegex = /Twinkle/gi; // Change this line
let result = twinkleStar.match(starRegex); // Change this line