#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "{{(((?!}}).)*}*}*)}}"
Local $sString = "{{for(var i = 0; i < sites.length; i++) { const site = sites[i]; }}" & @CRLF & _
"<div class="panel panel-default">" & @CRLF & _
" <div class="panel-heading" role="tab">" & @CRLF & _
" <h3 class="panel-title">" & @CRLF & _
" <a href="#{{site.Nom}}" onclick="event.preventDefault(); toggleOuvertureSite('{{site.Nom}}')" role="button">" & @CRLF & _
" {{site.Nom}} <span>({{site.Applications.length}})</span>" & @CRLF & _
" </a>" & @CRLF & _
" </h3>" & @CRLF & _
" </div>" & @CRLF & _
" <div class="panel-collapse collapse {{if(site.Ouvert){}}in{{}}}" id="{{site.Nom}}">" & @CRLF & _
" <div class="panel-body">" & @CRLF & _
" <div class="row">" & @CRLF & _
" <div class="col-md-6">" & @CRLF & _
" <h4>Chemins virtuels</h4>" & @CRLF & _
" {{if(site.Applications.length == 0) {}}" & @CRLF & _
" <em>Aucun chemin virtuel</em>" & @CRLF & _
" {{} else {}}" & @CRLF & _
" {{for(var j = 0; j < site.Applications.length; j++) { const application = site.Applications[j]; }}" & @CRLF & _
" <div>{{application.CheminVirtuel}}</div>" & @CRLF & _
" {{}}}}" & @CRLF & _
" </div>" & @CRLF & _
" <div class="col-md-6">" & @CRLF & _
" <h4>Liaisons</h4>" & @CRLF & _
" <table class="table table-condensed">" & @CRLF & _
" {{for(var j = 0; j < site.Liaisons.length; j++) { const liaison = site.Liaisons[j]; }}" & @CRLF & _
" <tr class="row">" & @CRLF & _
" <th class="col-xs-6">{{liaison.Protocole}}</th>" & @CRLF & _
" <td class="col-xs-6">{{liaison.Informations}}</td>" & @CRLF & _
" </tr>" & @CRLF & _
" {{}}}" & @CRLF & _
" </table>" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
"</div>" & @CRLF & _
"{{}}}" & @CRLF & _
""
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