第一个
Public Function SiteTempLabel(tStr)
SiteTempLabel = CustomLabel(tStr)
Set regEx=New RegExp '建立正规表达式
regEx.Pattern="(\{\$([\A-Za-z]+)\()([\s\S]+?)(\)})" '设置模式
regEx.IgnoreCase=True 设置全局性质
regEx.Global=True
Set Matches=regEx.Execute(tStr) '执行搜索
For Each Match in Matches
ExTagStr = regEx.Replace(Match.Value,"$2") '替换值
ExAnalyseStr = regEx.Replace(Match.Value,"$3")
tStr=Replace(tStr,Match.Value,LabelAnalyse(ExTagStr,ExAnalyseStr))
Next
Set Matches=Nothing
Set regEx=Nothing
SiteTempLabel = tStr
tStr = Empty
End Function
第二个
regE.Pattern="([\s\S]+?)("&aB&")([\s\S]+?)("&aE&")([\s\S]+)"
Set Matchess = regE.Execute(aStr)
For Each Matchs in Matchess
Select Case aType
Case 1
HCode = regE.Replace(Matchs.Value,"$1")
Case 2
HCode = regE.Replace(Matchs.Value,"$3")
Case 3
HCode = regE.Replace(Matchs.Value,"$5")
End Select
Next