#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?xJ)(?(DEFINE)" & @CRLF & _
"(?<add> \s*\+\s* )" & @CRLF & _
"(?<eq> \s*=\s* )" & @CRLF & _
"(?<carry> (?(cl)(?(cr)|\d0)|(?(cr)\d0|(*F))) ) " & @CRLF & _
"(?<b>" & @CRLF & _
" (?&add) (?:\d*(?:0|1(?<r1>)))? (?(ro)|(?=(?<cr>1)?)) (?=\k<e> (?&eq) \d*(?(?=(?(l1)(?(r1)|(*F))|(?(r1)(*F))))(?(?=(?&carry))1|0)|(?(?=(?&carry))0|1))\k<f>\b)" & @CRLF & _
"| (?=\d* (?&add) (?:\k<e>(?<ro>)|\d*(?<e>\d\k<e>)) (?&eq) \d*(?<f>\d\k<f>)\b) \d(?&b)" & @CRLF & _
")" & @CRLF & _
"(?<s> (?:0|1(?<l1>))(?=(?<cl>1)?\d*(?<e>) (?&add) \d* (?&eq) \d*(?<f>)\b)(?&b) )" & @CRLF & _
")" & @CRLF & _
"\b(?=(?:(?=(?&s))\d)+)[01]+(?&add)[01]+(?&eq)[01]+\b"
Local $sString = "1 + 1 = 1" & @CRLF & _
"0 + 1 = 1" & @CRLF & _
"01 + 10 = 11" & @CRLF & _
"010 + 010 = 100" & @CRLF & _
"101 + 10 = 111" & @CRLF & _
"101 + 10 = 101" & @CRLF & _
"11 + 101 = 1000" & @CRLF & _
"010 + 010 = 000" & @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