#include <Array.au3>
Local $Str = _
' <td height="30" class="fontsize12"><div align="center">考生姓名</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">xxx</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">开始日期</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">2012-12-31</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">开始时间</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">8:53:30</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">结束日期</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">2012-12-31</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">结束时间</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">9:33:30</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">试题数量</div></td>' & @CRLF & _
' <td class="fontsize12"><div align="center">40</div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' ' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">答对题数</div></td>' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center"> 12 </div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">答错题数</div></td>' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center"> 28 </div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' <tr> ' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center">总 得 分</div></td>' & @CRLF & _
' <td height="30" class="fontsize12"><div align="center" id=zf> ' & @CRLF & _
' ' & @CRLF & _
' <font color="#FF0000" >30</font> ' & @CRLF & _
' ' & @CRLF & _
' </div></td>' & @CRLF & _
' </tr>' & @CRLF & _
' ' & @CRLF & _
' </table>' & @CRLF
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExp($str, 'id=zf>\s+.+?>(\d+)', 3)
If Not @Error Then MsgBox(0, '匹配数量: ' & UBound($Test), '其中[0]元素为: ' & $Test[0])
_ArrayDisplay($Test, UBound($Test))
|