#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)<div(?!<div).*?\[label\*(.*?)\].*?<div"
Local $sString = "<div class="sect1" id="s9781473910270.i101"> " & @CRLF & _
"<div class="sect2" id="s9781473910270.i102">" & @CRLF & _
"<h1 class="title">1.2 Summations and Products[label*summation]</h1>" & @CRLF & _
"<p>text</p> " & @CRLF & _
"<div class="sect1" id="s9781473910270.i103">" & @CRLF & _
"sometext [ref*summation]" & @CRLF & _
"" & @CRLF & _
"<div class="figure" id="s9781473910270.i220">" & @CRLF & _
"<div class="metadata" id="s9781473910270.i221">" & @CRLF & _
"<p>fig1.2 [label*somefigure]</div>" & @CRLF & _
"sometext [ref*somefigure] "
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm