#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(\w{3})\s(\w{2})\s(\w+)"
Local $sString = " LMZ333 ALLOTMENT (0000) *TSC" & @CRLF & _
"HDQRM5I" & @CRLF & _
".MADRIIB 160846" & @CRLF & _
"MADIB HQXL4/MADIB0009/7849644/MAD/IB/A/ES//RC//" & @CRLF & _
"1CUVILEON/CARLOS EDUARDO" & @CRLF & _
"5I8397J/IB2198J25JUN RZGMAD CS1/0850 1220" & @CRLF & _
"5I8327J/IB2194J06JUL MADRZG CS1/1745 2115" & @CRLF & _
"OSI 5I CTCP 34606686051-M" & @CRLF & _
"OSI 5I POSI-DSAC//MADIB08AB/I/1" & @CRLF & _
"OSI 5I CARLOSCUVILIN//GMAIL.COM" & @CRLF & _
"= " & @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