#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([a-zA-Z]+\w*)[ \t]*=(?!=).+"
Local $sString = "aa = 100" & @CRLF & _
"bb=100" & @CRLF & _
"s=2" & @CRLF & _
"a90=0" & @CRLF & _
"a91 =0" & @CRLF & _
"a92 = 0" & @CRLF & _
"app = Mgr()" & @CRLF & _
"app2 = mary()" & @CRLF & _
"app3 = mary(x=2)" & @CRLF & _
"" & @CRLF & _
"# below should NOT match" & @CRLF & _
"" & @CRLF & _
"# a = 100" & @CRLF & _
"hello there" & @CRLF & _
"fred(xx=100)" & @CRLF & _
"def mary(xx=100)" & @CRLF & _
"77=0" & @CRLF & _
"88 = 0" & @CRLF & _
"a93 == 0" & @CRLF & _
"a94 0" & @CRLF & _
"a95 0 =" & @CRLF & _
"if __name__ == "__main__":" & @CRLF & _
" app.run(host="0.0.0.0", port=8000)" & @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