#include <Array.au3>
Local $sSource = _
' <div class="tt-yes">' & @CRLF & _
' <a href="/hh/rer76jhkkjkju.html" target="_blank">' & @CRLF & _
' <div class="myfile-by">' & @CRLF & _
' <div class="pc-this"><img src="/d/file/p/2018/07-03/pc09c1f72e98e5y4e887b65e8823cbf6.jpg" alt="产品编号"></div>' & @CRLF & _
' </div>' & @CRLF & _
' <div class="myfile-jt">' & @CRLF & _
' <h3 class="jt-name">产品编号</h3>' & @CRLF & _
' <span class="jt-xh">具体编号</span>' & @CRLF & _
' </div>' & @CRLF & _
' </a>' & @CRLF & _
' </div>'
;~MsgBox(0, '源字符串', $sSource)
Local $aSRE = StringRegExp($sSource, '(?si)<div\V+?src="([^"]+)"\h*alt="([^"]+)"></div>.+?">([^<]+)</span>\s+</div>', 3)
If Not @Error Then MsgBox(0, '匹配数量: ' & UBound($aSRE), '其中[0]元素为: ' & $aSRE[0])
_ArrayDisplay($aSRE, UBound($aSRE))
|