'格式化字符串 function strformat(str) strformat=str Dim regEx, Match, Matches ' 建立变量。 Set regEx =New RegExp ' 建立正则表达式。 regEx.Pattern ="["&vbcrlf&"]+"' 设置模式。 regEx.IgnoreCase =True' 设置是否区分字符大小写。 regEx.Global =True' 设置全局可用性。 Set Matches = regEx.Execute(str) ' 执行搜索 ForEach Match in Matches ' 遍历匹配集合。 strformat =replace(strformat,Match.Value,"<br/>") Next end function