#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "({})\1|[{](|\s*?[^\s{}]+?\s*?|\s*?\S+?\(.*?\)\s*?|\s*?['][^']+?[']\s*?|\s*?["][^"]+?["]\s*?|\s*?["][^"]+?["]\.\S+?\(.*?\)\s*?|\s*?['][^']+?[']\.\S+?\(.*?\)\s*?)(?:!(\S+?))?[}]"
Local $sString = "{k} must-match" & @CRLF & _
"{} jhtgj {} must-match" & @CRLF & _
"{ } not-match " & @CRLF & _
"" & @CRLF & _
"'"{firstName} {lastName}" <{email}>'" & @CRLF & _
"" & @CRLF & _
"{0.concat("8a b c d e", 6)} must-match" & @CRLF & _
"s df s sd{"one fielslkein 897sd'f8'97f 89s(*Y*&Sc {}d name".toFixed(7 , 8)} must-match" & @CRLF & _
"s df s sd{'one fielslkein "897sd"f897f 89s(*Y*&Sc {}d name'.toFixed(7 , 8)} must-match" & @CRLF & _
"sd{0.concat("8a b c d e", 6)} must-match" & @CRLF & _
"" & @CRLF & _
"ascdac{ "one fieldname" } must-match" & @CRLF & _
"ascdac{ "onefi eldname".kk(kk, "dd") } must-match" & @CRLF & _
"{onefieldname.toFixed(7 , 8)} must-match" & @CRLF & _
"dfgsdg { "onefieldname".toFixed(7 , 8)} must-match" & @CRLF & _
"{onefieldname: "toFixed(7 , 8)"} not-match" & @CRLF & _
"{"onefieldname": "toFixed(7 , 8)"} not-match" & @CRLF & _
"{ "onefiel dname" : "toFixed(7 , 8)"} not-match" & @CRLF & _
"{ "onefiel dname": 8} not-match " & @CRLF & _
"" & @CRLF & _
"{ "o dna" : {onefi eldname.l(7 , 8)} } not-match" & @CRLF & _
"{ "o dna" : {"onefi eldname".l(7 , 8)} } match-inner" & @CRLF & _
"{ "f dna" : {"onefi eldname".toFixed(7 , 8) }} match-inner" & @CRLF & _
"{ "f dna" : { "onefi eldname".toFixed(7 , 8) }} match-inner" & @CRLF & _
"{ "o dme" : {onefieldname.toFixed(7 , 8)} } match-inner" & @CRLF & _
"{ "on dname" : { onefieldname.toFixed(7 , 8)} } match-inner" & @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