网页代码如下:要将所有匹配的checkbox控件全部找出,并将所有的名字匹配<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=1
name=checkbox> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=2
name=checkbox2> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=3
name=checkbox3> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=4
name=checkbox4> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=5
name=checkbox5> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=6
name=checkbox6> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=7
name=checkbox7> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=8
name=checkbox8> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=9
name=checkbox9> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=10
name=checkbox10> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=11
name=checkbox11> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=12
name=checkbox12> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=13
name=checkbox13> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=14
name=checkbox14> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=15
name=checkbox15> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=16
name=checkbox16> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=17
name=checkbox17> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=18
name=checkbox18> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=19
name=checkbox1949> </DIV></TD>
</TR>
<TR>
<TD height=30>
<DIV class=STYLE19 align=center><INPUT type=checkbox value=20
name=checkbox20> </DIV></TD>
这样写提示错误: Local $nOffset = 1
Local $array
$array = StringRegExp($sHTML, 'checkbox\w*', 1, $nOffset)
For $i = 0 To UBound($array) - 1
MsgBox(0, "正则测试 标志值 1 - " & $i, $array[$i])
Next
|