var test = text.innerHTML; b = test.replace(/任晓强/g,"你好"); console.log(b); html: <div id="text"> 任晓强去吃饭,任晓强去开车,任晓强去上班 </div> 正则:/任晓强/g可替换所有任晓强,/任晓强/只可替换第一个任晓强. var test = text.innerHTML; b = test.replace(/(任晓强)/g,"<s…
Sub 表格单元格替换文字() If MsgBox("确定要替换单元格的文字吗?", vbYesNo + vbQuestion) = vbYes Then To ActiveDocument.Tables.Count , Column:=).Range .Delete .InsertAfter Text:="XXX" End With , Column:=).Range .Delete .InsertAfter Text:="与预期结果一致" E…