#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((?:(?P<p1>\((?:[^\(\)]|(?&p1))*\))|(?P<p2>[\w\.]))+)\s*[!=]=\s*((?:(?&p1)|(?&p2))+)"
Local $sString = "if (programWorkflowState.getTerminal(1, 2) == Boolean.TRUE) {" & @CRLF & _
"" & @CRLF & _
"Want: programWorkflowState.getTerminal(1, 2) and Boolean.TRUE" & @CRLF & _
"" & @CRLF & _
"boolean ignore = !_isInStatic.isEmpty() && (_isInStatic.peek() == 3) && isAnonymous;" & @CRLF & _
"" & @CRLF & _
"Want: _isInStatic.peek() and 3" & @CRLF & _
"" & @CRLF & _
"boolean b = (num1 * ( 2 + num2)) == value;" & @CRLF & _
"" & @CRLF & _
"Want: (num1 * ( 2 + num2)) and value"
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