#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\s*(?<nodename>\w+)\s*(?<nodevalue>.*)[^{]$"
Local $sString = "value CDTR ::= Record : {" & @CRLF & _
" origAddress {" & @CRLF & _
" ton xxx," & @CRLF & _
" npi yyy," & @CRLF & _
" pid xxx," & @CRLF & _
" msisdn "xxx"," & @CRLF & _
" dididk9 {xxx}" & @CRLF & _
" }," & @CRLF & _
" origAddressGSM 'xxxx'H," & @CRLF & _
" recipAddress {" & @CRLF & _
" ton xxx," & @CRLF & _
" npi xxx," & @CRLF & _
" pid xxxx," & @CRLF & _
" msisdn "xxxx"" & @CRLF & _
" }," & @CRLF & _
" recipAddressGSM 'xxxxx'H," & @CRLF & _
" submitDate 'xxx'H," & @CRLF & _
" submitTime 'xxxx'H," & @CRLF & _
" status xxx," & @CRLF & _
" terminDate 'xxx'H," & @CRLF & _
" terminTime 'xxx'H," & @CRLF & _
" lengthOfMessage xxx," & @CRLF & _
" prioIndicator xxx," & @CRLF & _
" validityPeriod {" & @CRLF & _
" hours x," & @CRLF & _
" minutes xxx" & @CRLF & _
" }," & @CRLF & _
" deferIndicator xxx," & @CRLF & _
" notifIndicator xxx," & @CRLF & _
" vsmscid xxxx," & @CRLF & _
" vsmsctype xxx," & @CRLF & _
" orglSubmitDate 'xxx'H," & @CRLF & _
" orglSubmitTime 'xxxx'H," & @CRLF & _
" transparentPid 1," & @CRLF & _
" intlMobileSubId 'xxxx'H," & @CRLF & _
" callingLineId {" & @CRLF & _
" ton xxxx," & @CRLF & _
" npi xxx," & @CRLF & _
" pid xxx," & @CRLF & _
" msisdn "xxx"" & @CRLF & _
" }," & @CRLF & _
" callingLineIdGSM 'xxxx'H," & @CRLF & _
" consolidation "xxxx"," & @CRLF & _
" portNumber xxxx," & @CRLF & _
" aser {}," & @CRLF & _
" mser {xxx}," & @CRLF & _
" nser {xxx}," & @CRLF & _
" xser {}," & @CRLF & _
" ppPser {xxx-pp}," & @CRLF & _
" cmReferenceNr xxx," & @CRLF & _
" currentSegment xxx," & @CRLF & _
" segmentsTotal xxxx" & @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