#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)GLOBAL_DATA\(([^)]*)\)(.*?)\};"
Local $sString = "//" & @CRLF & _
"// GameSettingData.h" & @CRLF & _
"// LowpolyJigsaw" & @CRLF & _
"//" & @CRLF & _
"// Created by Loc Nguyen on 8/4/17." & @CRLF & _
"//" & @CRLF & _
"//" & @CRLF & _
"" & @CRLF & _
"#ifndef GameSettingData_h" & @CRLF & _
"#define GameSettingData_h" & @CRLF & _
"" & @CRLF & _
"#include "GameCore/GameData/DataMacro.h"" & @CRLF & _
"" & @CRLF & _
"enum class GameSpeed" & @CRLF & _
"{" & @CRLF & _
" Slow," & @CRLF & _
" Normal," & @CRLF & _
" Fast" & @CRLF & _
"};" & @CRLF & _
"" & @CRLF & _
"struct Address" & @CRLF & _
"{" & @CRLF & _
" DATA(std::string, streetName, "");" & @CRLF & _
" DATA(std::string, houseNumber, "");" & @CRLF & _
" DATA(std::string, address, "");" & @CRLF & _
"};" & @CRLF & _
"" & @CRLF & _
"struct GLOBAL_DATA(GameSettingData)" & @CRLF & _
"{" & @CRLF & _
" GameSettingData()" & @CRLF & _
" {" & @CRLF & _
" address = new Address();" & @CRLF & _
" address->streetName = "No Trang Long";" & @CRLF & _
" address->houseNumber = "13";" & @CRLF & _
" }" & @CRLF & _
" " & @CRLF & _
" DATA(bool, isSoundEnable, true);" & @CRLF & _
" DATA(bool, isMusicEnable, true);" & @CRLF & _
" DATA(GameSpeed, gameSpeed, GameSpeed::Slow);" & @CRLF & _
" DATA(Address*, address, "");" & @CRLF & _
"};" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"struct GLOBAL_DATA(GameSettingData)" & @CRLF & _
"{" & @CRLF & _
" GameSettingData()" & @CRLF & _
" {" & @CRLF & _
" address = new Address();" & @CRLF & _
" address->streetName = "No Trang Long";" & @CRLF & _
" address->houseNumber = "13";" & @CRLF & _
" }" & @CRLF & _
" " & @CRLF & _
" DATA(bool, isSoundEnable, true);" & @CRLF & _
" DATA(bool, isMusicEnable, true);" & @CRLF & _
" DATA(GameSpeed, gameSpeed, GameSpeed::Slow);" & @CRLF & _
" DATA(Address*, address, "");" & @CRLF & _
"};" & @CRLF & _
"#endif /* GameSettingData_h */" & @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