Public Function LoopLabel(ByVal sContent As String)
Dim strText As String
'If InStr(sContent, "{loop") > 0 And InStr(sContent, "{/loop") > 0 Then
Dim regEx As New Regex("({loop:listnav})(.[^<]*)({/loop:listnav})")
Dim Contents As MatchCollection = regEx.Matches(sContent)
regEx = Nothing
For Each Match As Match In Contents ' 遍历匹配集合
strText = strText & Match.Value & "|" 'Replace(Label.Value, "{label:listname}", "替换OK")
Next
'End If
LoopLabel = strText
End Function
内容如下
{loop:listnav}
{loop:listli}
{label:listname}
{/loop:listli}
{loop:listul}
{loop:listli}
{label:listname}
{/loop:listli}
{/loop:listul}
{/loop:listnav}