ASP 高级模板引擎实现类(10)


        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

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2094.html