let txt = ` <td r-hide={!allFields[55+customFields.length+(activityLevelStr?1:0)+(goodsChoiceStr?1:0)].checked}>{item.goodsDto.supplier}</td> `; let reg = /(?=([\d]+?))+customFields.length/g; // console.log(reg.test(txt)) let newText = txt.replace(/\d+/g, (target) => { console.log(target) return Number(target) + 1; }) // console.log(newText); var text = "吾辈既务斯业009090,便当3333专心用功"; var reg1 = /[\\d]/; var reg2 = /[^\\d]/; // console.log(reg1.exec(text)); // console.log(reg2.exec(text));