#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(\w+) +\w+ +(?:\[[^\]]+\] *)?"
Local $sString = "0000 10 Text("TOTAL,SOME RANDOM TEXT") (1122aabb)" & @CRLF & _
"0010 5 D==1122aabb (1122aabb)" & @CRLF & _
"0015 17 Text("AND,SOME,MORE") (00000001)" & @CRLF & _
"002c 5 D==1 (1)" & @CRLF & _
"0031 1 !D (ccdd3344)" & @CRLF & _
"0032 5 D==ccdd3344 (ccdd3344)" & @CRLF & _
"0037 2 !1 (1)" & @CRLF & _
"0039 0 [AAAA] Fff" & @CRLF & _
"0039 1 [BBBB] Aaa" & @CRLF & _
"003a 6 N(05, eeff5566) (eeff5566)" & @CRLF & _
"0040 1 Qq" & @CRLF & _
"0041 2 $ab ([String]:"Unknown")" & @CRLF & _
"0043 f Call A/SomeFunc-X" & @CRLF & _
"0052 1 cd"
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