#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((@[\w\d][\w\d_]+)\s+)?(\.[\w\d][\w\d_]+\s+)"
Local $sString = "@array .byte 3, 4, 23" & @CRLF & _
"va1 .byte 'A', -3, 0xAB // Three bytes" & @CRLF & _
"@str1 .byte "Enter an integer: " // Null-terminated string" & @CRLF & _
"@var2 .hword 0xABCD:10 // 0xABCD is replicated 10 times" & @CRLF & _
"@var3 .word -18, 5.7E-3 // 4-byte integer, single float" & @CRLF & _
"@var4 .dword 21, 21.0 // 8-byte integer, double float" & @CRLF & _
"" & @CRLF & _
"//Assembly Language Syntax:" & @CRLF & _
"J @label // Jump @label" & @CRLF & _
"JAL @label // R31 = (PC+4); Jump @label" & @CRLF & _
"The JAL instruction saves the return address "
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