#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(^\s+(?P<att_name>[^\s]+)\s+(?P<att_value>[^\s{]+|"[^"]+?")\s?(?P<att_body>{[\s\S]+?})?)$"
Local $sString = "" & @CRLF & _
" rel_tgt_id 2" & @CRLF & _
" IncomingUser "user1234 secret123456"" & @CRLF & _
" GROUP access_group{" & @CRLF & _
" LUN 0 dev2-0" & @CRLF & _
" LUN 1 dev2-1" & @CRLF & _
" LUN 2 dev2-2" & @CRLF & _
" LUN 3 dev2-3" & @CRLF & _
" LUN 4 dev2-4" & @CRLF & _
" LUN 5 dev2-5" & @CRLF & _
" LUN 6 dev2-6" & @CRLF & _
" LUN 7 dev2-7" & @CRLF & _
" LUN 8 dev2-8" & @CRLF & _
" LUN 9 dev2-9" & @CRLF & _
" INITIATOR iqn.1994-09.org.freebsd:*" & @CRLF & _
" }" & @CRLF & _
" enabled 1" & @CRLF & _
" MaxSessions 10" & @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