var b="abeeee:eeeee:eeeeeab"; console.log(b.match(/e+\:e+/g));//["eeee:eeeee"]貪婪模式,只顯示第一個匹配到的 console.log(b.match(/e+?\:e+?/g));//["eeee:e", "eeee:e"]非貪婪模式,從前向后查詢 console.log(b.match(/e+\:(?=e+)/g));//["eeee:", "eeeee:"] console.log(b.match(/e+?\:(?=e+)/g));//["eeee:", "eeeee:"] console.log(b.match(/(?<=e+)?\:(?=e+)/g));//[":", ":"] console.log(b.match(/e+?\:(?!e+)/g));//null console.log(b.match(/(?:e+)?\:(?:e+?)/g));//["eeee:e", "eeee:e"]