本帖最后由 lixiaolong 于 2012-6-4 23:42 编辑
#include <Array.au3>
Local $Str = _
'<SCRIPT type=text/javascript>100</SCRIPT>' & @CRLF & _
'<TD>2011/01/10</TD>' & @CRLF & _
'<TD></TD>' & @CRLF & _
'<TD>2011/01/11</TD>' & @CRLF & _
'<TD>2011/01/12</TD>' & @CRLF & @CRLF & _
'<SCRIPT type=text/javascript>101</SCRIPT>' & @CRLF & _
'<TD>2011/01/20</TD>' & @CRLF & _
'<TD>2011/01/21</TD>' & @CRLF & _
'<TD></TD>' & @CRLF & _
'<TD>2011/01/23</TD>' & @CRLF & @CRLF & _
'<SCRIPT type=text/javascript>102</SCRIPT>' & @CRLF & _
'<TD>2011/02/10</TD>' & @CRLF & _
'<TD>2011/02/20</TD>' & @CRLF & _
'<TD>2011/02/21</TD>' & @CRLF & _
'<TD>2011/02/22</TD>' & @CRLF & @CRLF & _
'<SCRIPT type=text/javascript>103</SCRIPT>' & @CRLF & _
'<TD>2011/02/20</TD>' & @CRLF & _
'<TD>2011/02/19</TD>' & @CRLF & _
'<TD>2011/02/19</TD>' & @CRLF & _
'<TD>2011/01/20</TD>' & @CRLF
Local $Test = StringRegExp($str, '(?s)(?=<SCRIPT.*?/SCRIPT>\s+(?:<TD>(.*?)</TD>.*?){3})', 3)
_ArrayDisplay($Test, UBound($Test))
If Not @error Then
For $i = 0 To UBound($Test) - 1
MsgBox(0, '', $Test[$i])
Next
EndIf
|