asp 用正则表达式提取出自定义标签中的内容
asp用正则表达式提取出自定义标签中的内容,并且放入数组中,如:<tablewidth="100%"border="0"cellspacing="5"cellpaddin...
asp 用正则表达式提取出自定义标签中的内容,并且放入数组中,如:
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><GB:List>AAAA</GB:List></td>
</tr>
<tr>
<td><GB:List>BBBB</GB:List></td>
</tr>
</table>
就是吧AAAA,BBBB从我的自定义标签中提取出,然后放入数组中,asp脚本
<GB:List></GB:List>是我的自定义标签,类似<div></div>
我已经提高分数了,麻烦高手帮个忙 展开
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><GB:List>AAAA</GB:List></td>
</tr>
<tr>
<td><GB:List>BBBB</GB:List></td>
</tr>
</table>
就是吧AAAA,BBBB从我的自定义标签中提取出,然后放入数组中,asp脚本
<GB:List></GB:List>是我的自定义标签,类似<div></div>
我已经提高分数了,麻烦高手帮个忙 展开
1个回答
展开全部
Dim Re as RegexP,
Dim Array(), i, colMatches
i = 1
Set re = new RegexP
With Re
.Pattern = "(?<=<GB:List>)[^\s<]+(?=\s*<GB)"
.IgnoreCase = True
End With
Set colMatches = re.Execute($$$Your_String)
for each Match in colMatches
Array(i) = Match.Value
i = i+1
Next
ReDim Preserve Array()
Dim Array(), i, colMatches
i = 1
Set re = new RegexP
With Re
.Pattern = "(?<=<GB:List>)[^\s<]+(?=\s*<GB)"
.IgnoreCase = True
End With
Set colMatches = re.Execute($$$Your_String)
for each Match in colMatches
Array(i) = Match.Value
i = i+1
Next
ReDim Preserve Array()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询