#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\[(?<OSM_Observation>[^\]]*)\]$"
Local $sString = "1 2023-04-25 06-02-10112022-85346-L 7ff79dca-a39b-4b00-8b76-bee72efbcb83 CreateQPBillingEvents" & @CRLF & _
"Insert into tables failed-ORA-00001:Duplicate Check Fail for ORDER_ID[06-02-10112022-85346-L] TROUBLE_TICKET_ID[] CHARGETYPE [RSCN4]" & @CRLF & _
"2 2023-04-25 06-02-10112022-85346-L a08f16a0-2789-4216-a42d-623fae84c0b7 CreateQPBillingEvents" & @CRLF & _
"Insert into tables failed-ORA-00001:Duplicate Check Fail for ORDER_ID[06-02-10112022-85346-L] TROUBLE_TICKET_ID[] CHARGETYPE [RSCN3]" & @CRLF & _
"3 2023-04-25 06-02-10112022-85346-L 9e0f0d13-488e-4e6a-934f-a5eb36c015ca CreateQPBillingEvents" & @CRLF & _
"Insert into tables failed-ORA-00001:Duplicate Check Fail for ORDER_ID[06-02-10112022-85346-L] TROUBLE_TICKET_ID[] CHARGETYPE [RSCN3]" & @CRLF & _
"4 2023-04-25 06-02-10112022-85346-L 687e81b7-30b6-490e-90e6-552d09741a54 CreateQPBillingEvents" & @CRLF & _
"Insert into tables failed-ORA-00001:Duplicate Check Fail for ORDER_ID[06-02-10112022-85346-L] TROUBLE_TICKET_ID[] CHARGETYPE [RSCN4]" & @CRLF & _
"5 2023-04-24 06-02-10112022-85346-L 85d38933-bc8f-4c56-944b-a1acd264140c CreateQPBillingEvents" & @CRLF & _
"Insert into tables failed-ORA-00001:Duplicate Check Fail for ORDER_ID[06-02-10112022-85346-L] TROUBLE_TICKET_ID[] CHARGETYPE [RSCN3]"
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