dupd
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"]

 

分类:

技术点:

相关文章:

  • 2021-09-17
  • 2021-08-10
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2018-05-08
  • 2021-11-29
  • 2021-11-18
猜你喜欢
  • 2021-11-29
  • 2021-11-20
  • 2021-05-10
  • 2021-09-25
  • 2021-11-29
  • 2021-11-14
  • 2021-11-29
相关资源
相似解决方案