ASP自定义标签参数怎么实现替换
ASP自定义标签参数怎么实现替换??请高手指点<%
Function RegReplace(Str,Pattern,StrReplace)
Dim Reg
Set Reg = New RegExp
Reg.IgnoreCase = True
Reg.Global = True
Reg.Pattern = Pattern
'RegReplace = Reg.Replace(Str,StrReplace)
Set Matches = Reg.Execute(Str)
For Each Match In Matches
StrM = StrM & Match.Value & "|"
Next
StrM = Replace(StrM,"#","")
RegReplace = StrM
End Function
Str = "dsfs#SMH_OK(1,3,4)#dsfsdsfs#SMHOK(1,3,4)#dsfsdsfs#SMH123(1,3,4)#dsfs<Font color=red>#SMH123(1,3,4)#</Font>"
Pattern = "#SMH[\w]+?\([\d\,]+?\)#"
StrReplace = "<b>$1</b>"
Response.Write RegReplace(Str,Pattern,StrReplace)
Function SMH_OK(A,B,C)
Str = A + B + C
End Function
%>