Skip to main content

Posts

Showing posts with the label flags

正则表达式中的flag

 题目: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 );