#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(((((#)|())(([ \t\n]+|()))([a-zA-Z0-9]+)([ \t\n]+))|())((([ \t\n]+|()))((move|mult)|([a-z]+)))((([ \t\n]+|()))(:))((([ \t\n]+|()))([a-zA-Z0-9,&\* \t\"\n\[\]]+))(;))|((([ \t\n]+|()))((save|end)|([a-z]+))(([ \t\n]+|()))(;))"
Local $sString = "" & @CRLF & _
"{" & @CRLF & _
" stream: gogo;" & @CRLF & _
" move: some, reg1;" & @CRLF & _
" #jix mult: &num, reg2;" & @CRLF & _
" push: reg2;" & @CRLF & _
" sus : 0x20;" & @CRLF & _
" add : him, her;" & @CRLF & _
" #goto " & @CRLF & _
" jump: loop;" & @CRLF & _
" dec : him, *reg2;" & @CRLF & _
" #get" & @CRLF & _
" add : onu, buna;" & @CRLF & _
" jump: goto;" & @CRLF & _
" #mydear move: "moses", rgb[8]; " & @CRLF & _
" save ;" & @CRLF & _
" end ;" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"{" & @CRLF & _
" move: mos, reg1;" & @CRLF & _
" mult: &num, reg2;" & @CRLF & _
" push: reg2;" & @CRLF & _
" int : 0x20;" & @CRLF & _
" #lab" & @CRLF & _
" add : him, her;" & @CRLF & _
" jump: loop;" & @CRLF & _
" #mos" & @CRLF & _
" dec: him, *reg2;" & @CRLF & _
" #inst" & @CRLF & _
" add: onu, buna;" & @CRLF & _
" jump: lab;" & @CRLF & _
" save;" & @CRLF & _
" end;" & @CRLF & _
"" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"{" & @CRLF & _
" inc: moses, to;" & @CRLF & _
" #io" & @CRLF & _
" push: him;" & @CRLF & _
" #kim" & @CRLF & _
" jump: frame;" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
" okbro () {" & @CRLF & _
" dec: him, beat;" & @CRLF & _
" #his" & @CRLF & _
" push: him;" & @CRLF & _
" jump: main;" & @CRLF & _
" ret; }"
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