#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "#{[\w]+\((\d+),(\d+)\)}"
Local $sString = "#{if(total,0)}#{else}" & @CRLF & _
"<div id="recommend">" & @CRLF & _
" <div class="title"><p>Title</p></div>" & @CRLF & _
" #{item(1,5)}" & @CRLF & _
" <div class="layout">" & @CRLF & _
" <div class="item">" & @CRLF & _
" <a href="#{url}"><img border="0" alt="#{name}" src="#{image}"></a>" & @CRLF & _
" </div>" & @CRLF & _
" <div class="goods">" & @CRLF & _
" <a href="#{url}">#{truncate(name,27)}</a>" & @CRLF & _
" </div>" & @CRLF & _
" <div class="price">#{comma(price_tax)}</div>" & @CRLF & _
" </div>" & @CRLF & _
" #{/item}" & @CRLF & _
" <br clear="all">" & @CRLF & _
"</div>" & @CRLF & _
"#{/if}"
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