ASP 高级模板引擎实现类

2019-04-01 19:06:30王振洲

        Set Matches = GetMatch(Text, "$(d+?)")
        If Matches.Count > 0 Then
            For Each SubMatches In Matches
                Text = Replace(Text, SubMatches.value, doQuote(Arrays(SubMatches.SubMatches(0), i)), 1, -1, 1) '执行替换
            Next
            ItemReSec = Text
        Else
            ItemReSec = ""
        End If
        Set Matches = Nothing
    End Function

    ' ***************************************
    '    全局变量函数
    ' ***************************************
    Private Sub ExecuteFunction
        Dim Matches, SubMatches, Text, ExeText
        Set Matches = GetMatch(c_Content, "<function:([0-9a-zA-Z_.]*?)((.*?)""(.+?)""(.*?))/>")
        If Matches.Count > 0 Then
            For Each SubMatches In Matches
                Text = SubMatches.SubMatches(0) & "(" & SubMatches.SubMatches(1) & """" & SubMatches.SubMatches(2) & """" & SubMatches.SubMatches(3) & ")"
                Execute "ExeText=" & Text
                c_Content = Replace(c_Content, SubMatches.value, ExeText, 1, -1, 1)
            Next
        End If
        Set Matches = Nothing
    End Sub

    ' ***************************************
    '    普通替换全局标签
    ' ***************************************
    Public Property Let Sets(ByVal t, ByVal s)
        Dim SetMatch, Bstr, SetSubMatch
        Set SetMatch = GetMatch(c_Content, "(<Set:([0-9a-zA-Z_.]*?)(((.*?)" & t & "(.*?))?)/>)")
        If SetMatch.Count > 0 Then