题目:Using the regex starRegex, find and extract both Twinkle words from the string twinkleStar.
let twinkleStar = "Twinkle, twinkle, little star";
let starRegex = /Twinkle/ig; // 多个flag,i表示ignorance,g表示global
let result = twinkleStar.match(starRegex);
Comments
Post a Comment