"j1c" <ju********@yahoo.ca> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Thanks for the tips - it is working very well.
1 thing though - in the RegEx what would I need to change to allow
either:
<!--tag:01-->content<!--/tag:01-->
OR
<!--tag:01-->
content
<!--/tag:01-->
<%
Dim s, arr, re
s = _
"<!--tag:1-->Content 1<!--/tag:1--><br>" &_
"<!--tag:2-->Content 2<!--/tag:2--><br>" &_
"<!--tag:3-->Content 3<!--/tag:3--><br>" &_
"<!--tag:4-->Content 4<!--/tag:4--><br>" &_
"<!--tag:5-->Content 5<!--/tag:5--><br>" &_
"<!--tag:6-->Content 6<!--/tag:6--><br>" &_
"<!--tag:7-->Content 7<!--/tag:7--><br>" &_
"<!--tag:8-->Content 8<!--/tag:8--><br>" &_
"<!--tag:9-->Content 9<!--/tag:9--><br>" &_
"<!--tag:10-->" & vbCRLF & "Content 10" & vbCRLF & "<!--/tag:10-->"
arr = Array(1,5,7)
Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.MultiLine=True
re.Pattern = "(<!--tag:(?!(" & Join(arr,"|") &
")-)(\d+)-->)(.|\n)*?(<!--/tag:\3-->)"
Response.Write re.Replace(s,"$1$5")
%>