#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)<div(?:(?!</div>).)*<div(?:(?!</div>).)*{{ upc }}.*?</div>\s*</div>"
Local $sString = "<div class="form-group">" & @CRLF & _
" <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>" & @CRLF & _
" <div class="col-sm-10">" & @CRLF & _
" <input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control"/>" & @CRLF & _
" </div>" & @CRLF & _
"</div>" & @CRLF & _
"<div class="form-group">" & @CRLF & _
" <label class="col-sm-2 control-label" for="input-upc"><span data-toggle="tooltip" title="{{ help_upc }}">{{ entry_upc }}</span></label>" & @CRLF & _
" <div class="col-sm-10">" & @CRLF & _
" <input type="text" name="upc" value="{{ upc }}" placeholder="{{ entry_upc }}" id="input-upc" class="form-control"/>" & @CRLF & _
" </div>" & @CRLF & _
"</div>" & @CRLF & _
"<div class="form-group">" & @CRLF & _
" <label class="col-sm-2 control-label" for="input-ean"><span data-toggle="tooltip" title="{{ help_ean }}">{{ entry_ean }}</span></label>" & @CRLF & _
" <div class="col-sm-10">" & @CRLF & _
" <input type="text" name="ean" value="{{ ean }}" placeholder="{{ entry_ean }}" id="input-ean" class="form-control"/>" & @CRLF & _
" </div>" & @CRLF & _
"</div>"
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