#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)Product ID\s*:\s*(?<PRODUCTID>\w+)\s*Quantity\s*:\s*(?<QUANTITY>\w+)\s*Item\s*:\s*(?<ITEM>\w+)[\s\S]*?NEXT\s*ACTIONS\s*(?<NEXTACTIONS>.*)"
Local $sString = "-----------------------------------------------------------------------------" & @CRLF & _
"Product ID : TXSKJI1123321" & @CRLF & _
"Quantity : 19" & @CRLF & _
"Item : Jeans" & @CRLF & _
"-----------------------------------------------------------------------------" & @CRLF & _
"NEXT ACTIONS" & @CRLF & _
"IF Stock less than 10 " & @CRLF & _
"Then increase stock for TXSKJI1123321 up to 100 units" & @CRLF & _
"Else" & @CRLF & _
"No action needed" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"-----------------------------------------------------------------------------" & @CRLF & _
"Product ID : AKSP2790173332" & @CRLF & _
"Quantity : 7" & @CRLF & _
"Item : Shirts" & @CRLF & _
"-----------------------------------------------------------------------------" & @CRLF & _
"NEXT ACTIONS" & @CRLF & _
"Increase stock for AKSP2790173332 up to 50 units" & @CRLF & _
"" & @CRLF & _
"-----------------------------------------------------------------------------" & @CRLF & _
"Product ID: AKSP27901733789" & @CRLF & _
"Quantity : 2" & @CRLF & _
"Item : Vest" & @CRLF & _
"-----------------------------------------------------------------------------" & @CRLF & _
"NEXT ACTIONS" & @CRLF & _
"Increase stock for AKSP27901733789 up to 15 units"
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