日期:2014-05-17 浏览次数:20917 次
Dim regex, result Set regex = New RegExp regex.Pattern = "\[face(\d+)\]" regex.IgnoreCase = True regex.Global = True result = regex.Replace(strIn, "<img src=""img/$1.jpg"">") Set regex = Nothing Response.Write result
------解决方案--------------------
Dim regex, strin, result, count strin = "asdf[face1]dsdafasdfdsf[face12]dasf[face3]asdf[face5]asdf" Set regex = New RegExp regex.Pattern = "\[face(\d+)\]" regex.IgnoreCase = True regex.Global = True result = regex.Replace(strin, "<img src=""img/$1.jpg"">") count = regex.Execute(strin).Count Set regex = Nothing Response.Write "替换结果:" & result Response.Write "<br />----------<br />" Response.Write "表情个数:" & count