#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([*]\s(?!\d|--).+)((?:\n(?!--).*)*)"
Local $sString = "* 02.04.2021 09:23:25 CET #PRS~ #PRS~ ( #UID~ ) Tél. #TEL~ #TEL~" & @CRLF & _
"NonConformity 0001 :" & @CRLF & _
"Type of nonconformity : Scratch" & @CRLF & _
"* NonConformity 0002 :" & @CRLF & _
"Type of nonconformity : Scratch - cosmetical item" & @CRLF & _
"* Il a été constaté des rayures sur L'ENS CASQUETTE réf :" & @CRLF & _
"D54." & @CRLF & _
"* Voir standard doc." & @CRLF & _
"* Nous demandons le renvoi de la pièce pour une remise en" & @CRLF & _
"conformité." & @CRLF & _
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & @CRLF & _
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & @CRLF & _
"02.04.2021 09:31:27 CET #PRS~ #PRS~ ( #UID~ ) Tél. #TEL~ #TEL~" & @CRLF & _
"Task Completed : 0100 `` DEC0 ``" & @CRLF & _
"Decision Taken : REJECT" & @CRLF & _
"Justification :" & @CRLF & _
"" & @CRLF & _
"* 02.04.2021 09:23:25 CET #PRS~ #PRS~ ( #UID~ ) Tél. #TEL~ #TEL~" & @CRLF & _
"NonConformity 0001 :" & @CRLF & _
"Type of nonconformity : Scratch" & @CRLF & _
"* 4 NonConformity 0002 :" & @CRLF & _
"Type of nonconformity : Scratch - cosmetical item" & @CRLF & _
"* Il a été constaté des rayures sur L'ENS CASQUETTE réf :" & @CRLF & _
"D54." & @CRLF & _
"* Voir standard doc." & @CRLF & _
"* Nous demandons le renvoi de la pièce pour une remise en" & @CRLF & _
"conformité." & @CRLF & _
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & @CRLF & _
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" & @CRLF & _
"02.04.2021 09:31:27 CET #PRS~ #PRS~ ( #UID~ ) Tél. #TEL~ #TEL~" & @CRLF & _
"Task Completed : 0100 `` DEC0 ``" & @CRLF & _
"Decision Taken : REJECT" & @CRLF & _
"Justification :"
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