#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^((?(3)|\)*)(?>\((?2)*(()(?1))?(\)|$)|0|"[^\n"]*.?|(1|(2|(3|4(?1))(?1))(?1))(?1)))*\)*$"
Local $sString = "Truthy:" & @CRLF & _
"" & @CRLF & _
"0" & @CRLF & _
")" & @CRLF & _
"(" & @CRLF & _
""" & @CRLF & _
"()" & @CRLF & _
"""" & @CRLF & _
"10" & @CRLF & _
"400010" & @CRLF & _
"210010" & @CRLF & _
"("")00" & @CRLF & _
"3"""""" & @CRLF & _
"2(2(2(0)0)0)0" & @CRLF & _
"2"010""44)()4"" & @CRLF & _
")31(0)0(20102010" & @CRLF & _
"())2)1))0"3())"))" & @CRLF & _
"3("4321("301(0)21100"4")"123"00)40"121"31000""01010" & @CRLF & _
"" & @CRLF & _
"Falsy:" & @CRLF & _
"" & @CRLF & _
"1" & @CRLF & _
"1(310" & @CRLF & _
"12(010" & @CRLF & _
"4"00010"" & @CRLF & _
"3120102100" & @CRLF & _
"20(2((0)(0)))" & @CRLF & _
"2(2(2(0)0)0)01)" & @CRLF & _
"4(0102)00)00000" & @CRLF & _
"2"00"("00"2(""))" & @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