#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)(^Test case ([A-Za-z]+)\s+Current Parameters:(?:[^:]+:.*?$)*)+.*?(Test \2 (PASS|FAIL))"
Local $sString = "Test case AAA" & @CRLF & _
"Current Parameters:" & @CRLF & _
" Some unique param : 1" & @CRLF & _
" Some unique param : 2" & @CRLF & _
" Some unique param : 3" & @CRLF & _
" Some unique param : 4" & @CRLF & _
"*A line of rubbish*" & @CRLF & _
"*Another line of rubbish*" & @CRLF & _
"*Yet another line of rubbish*" & @CRLF & _
"*More and more rubbish*" & @CRLF & _
"Test AAA PASS" & @CRLF & _
"Test case BBB" & @CRLF & _
"Current Parameters:" & @CRLF & _
" Some unique param : A" & @CRLF & _
" Some unique param : B" & @CRLF & _
" Some unique param : C" & @CRLF & _
" Some unique param : D" & @CRLF & _
"*A line of rubbish*" & @CRLF & _
"*Another line of rubbish*" & @CRLF & _
"*Yet another line of rubbish*" & @CRLF & _
"*More and more rubbish*" & @CRLF & _
"Test BBB PASS"
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