Open Yang03 opened 5 years ago
?= 'abcacad'.replace(/a(?=b)/g,'*') //*bcacad
'abcacad'.replace(/a(?!b)/g,'*') //abc*c*d
let str="123456789"; let re=/(?=(?!(\b))(\d{3})+$)/g str=str.replace(re, ",") console.log(str)
\b 是单词边界
\b
前向声明
反前向声明
\b
是单词边界