28,391
社区成员
发帖
与我相关
我的任务
分享
<%
Dim str,reg1,reg2
str="<table><tr><th>姓名</th><th>身高</th><th>年纪</th><th>学历</th> </tr><tr><td>张三</td><td>198厘米</td><td>25</td> <td>小学</td></tr><tr><td>李四</td><td>178厘米</td><td>18</td><td>大学</td></tr></table>"
set reg1 = New RegExp
set reg2 = New RegExp
reg1.Global=true
reg1.Pattern="<th.*?>([\W\w]*?)<\/th>"
reg1.IgnoreCase = True
reg2.Global=true
reg2.Pattern="<td.*?>([\W\w]*?)<\/td>"
reg2.IgnoreCase = True
Set matches1=reg1.execute(str)
Set matches2=reg2.execute(str)
Dim num
num=matches1.count
max=matches2.count / matches1.count
For i=0 To max-1
response.write "序号:" & i+1 &"<br />"
For j=0 To num-1
response.write matches1(j).value &":" & matches2(i*num+j).value &"<br />"
Next
response.write "<br />"
Next
%>
<%
Dim str,reg1,reg2
str="<table><tr><th width=""19"" stype=""color=red"">姓名</th><th>身高</th><th>年纪</th><th>学历</th> </tr><tr><td>张三</td><td>198厘米</td><td>25</td> <td>小学</td></tr><tr><td>李四</td><td>178厘米</td><td>18</td><td>大学</td></tr></table>"
set reg1 = New RegExp
set reg2 = New RegExp
reg1.Global=true
reg1.Pattern="<th[^>]*>([\W\w]*?)<\/th>"
reg1.IgnoreCase = True
reg2.Global=true
reg2.Pattern="<td[^>]*>([\W\w]*?)<\/td>"
reg2.IgnoreCase = True
Set matches1=reg1.execute(str)
Set matches2=reg2.execute(str)
Dim num
num=matches1.count
max=matches2.count / matches1.count
For i=0 To max-1
response.write "序号:" & i+1 &"<br />"
For j=0 To num-1
response.write matches1(j).value &":" & matches2(i*num+j).value &"<br />"
Next
response.write "<br />"
Next
%>
<%
Dim str,reg1,reg2
str="<table><tr><th>姓名</th><th>身高</th><th>年纪</th><th>学历</th> </tr><tr><td>张三</td><td>198厘米</td><td>25</td> <td>小学</td></tr><tr><td>李四</td><td>178厘米</td><td>18</td><td>大学</td></tr></table>"
set reg1 = New RegExp
set reg2 = New RegExp
reg1.Global=true
reg1.Pattern="<th>([\W\w]*?)<\/th>"
reg1.IgnoreCase = True
reg2.Global=true
reg2.Pattern="<td>([\W\w]*?)<\/td>"
reg2.IgnoreCase = True
Set matches1=reg1.execute(str)
Set matches2=reg2.execute(str)
Dim num
num=matches1.count
max=matches2.count / matches1.count
For i=0 To max-1
response.write "序号:" & i+1 &"<br />"
For j=0 To num-1
response.write matches1(j).value &":" & matches2(i*num+j).value &"<br />"
Next
response.write "<br />"
Next
%>