'ܡԶģǩ
Function ProcessCustomTags(ByVal sContent)
         Dim objRegEx, Match, Matches
      'ʽ
         Set objRegEx = New RegExp
      '
         objRegEx.Pattern = "<tag:.*/>"
      'ԴСд
         objRegEx.IgnoreCase = True
      'ȫֲ
         objRegEx.Global = True
      'Run the search against the content string we've been passed
         Set Matches = objRegEx.Execute(sContent)
      'ѭѷֵƥ
         For Each Match in Matches
         'Replace each match with the appropriate HTML from our ParseTag function
         sContent = Replace(sContent, Match.Value, ParseTag(Match.Value))
         Next
      'ٶ
         set Matches = nothing
         set objRegEx = nothing
      'ֵ
         ProcessCustomTags = sContent
End Function


'ܡȡģǩĲ
'磺<tag:loop channelid="1" pagesize="10" title="20" type="NEW" column="1">
function GetAttribute(ByVal strAttribute, ByVal strTag)
      Dim objRegEx, Matches
      'ʽ
         Set objRegEx = New RegExp
      ' (the attribute name followed by double quotes etc)  
         objRegEx.Pattern = lCase(strAttribute) & "=""[0-9a-zA-Z]*"""
      'ԴСд
         objRegEx.IgnoreCase = True
      'ȫֲ
         objRegEx.Global = True
      'ִ
         Set Matches = objRegEx.Execute(strTag)
      'ƥ򷵻ֵ, Ȼؿֵ
         if Matches.Count > 0 then
              GetAttribute = Split(Matches(0).Value,"""")(1)
         else
              GetAttribute = ""
         end if
      'ٶ
         set Matches = nothing
         set objRegEx = nothing
end function



'ܡ滻Ӧģǩ
function ParseTag(ByVal strTag)
      dim arrResult, ClassName, arrAttributes, sTemp, i, objClass
      'ǩǿյ˳
         if len(strTag) = 0 then exit function
      'Split the match on the colon character (:)
         arrResult = Split(strTag, ":")
      'Split the second item of the resulting array on the space character, to
         'retrieve the name of the class
         ClassName = Split(arrResult(1), " ")(0)
         'Use a select case statement to work out which class we're dealing with
         'and therefore which properties to populate etc
         select case uCase(ClassName)
         'It's a loop class, so instantiate one and get it's properties
         case "LOOP" 
       '              set objClass = new LOOP_Class
       '             LOOP.Channelid= GetAttribute("channelid", strTag")
       '              LOOP.Pagesize= GetAttribute("pagesize", strTag")
       '              LOOP.title = GetAttribute("title", strTag")
       '              LOOP.type = GetAttribute("Type", strTag")
       '              ParseTag = LOOP.column (GetAttribute("column", strTag"), true)
       '              'Destroy our class object
       '              set objClass = nothing
         end select
end function