正则表达时,贪婪模式,.*会一直匹配到最后一个
// 验证 let str = "hello world"; let res = str.replace(/(.*)l/,'$10'); //$1 + 替换后的字符 console.log(res); // hello wor0d