#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\[TestCaseSource\(\"ALM\"\)\](.*|\n)*\}"
Local $sString = " [TestCaseSource("ALM")]" & @CRLF & _
" public void AccountFinancialTest(string testSetId)" & @CRLF & _
" {" & @CRLF & _
" TestCaseDetails tcd = new TestCaseDetails();" & @CRLF & _
" tcd.TestSetId = testSetId;" & @CRLF & _
" tcd.TestFeature = "CBSD-9451 C3 FI BSA financial attributes migration";" & @CRLF & _
" tcd.TestName = "CBSD-13027 TEST: Lean FT tests for financial sequence part 2";" & @CRLF & _
" tcd.TestCase = "AccountFinancial_BALANCE";" & @CRLF & _
"" & @CRLF & _
" env = "DEV";" & @CRLF & _
" system = "DATASTAGE";" & @CRLF & _
" team = "TRANSFORMERS";" & @CRLF & _
" tvs = new TestValidationService();" & @CRLF & _
" Credentials.Server = GetFieldValue("SERVER");" & @CRLF & _
" Credentials.DefaultDataStageProject = GetFieldValue("PROJECT");" & @CRLF & _
" Credentials.Domain = GetFieldValue("DOMAIN");" & @CRLF & _
"" & @CRLF & _
" T24connectionstring = GetFieldValue("T24CONNECTIONSTRING");" & @CRLF & _
" T24schema = GetFieldValue("T24SCHEMA");" & @CRLF & _
"" & @CRLF & _
" Db2connectionstring = GetFieldValue("DB2CONNECTION");" & @CRLF & _
" Db2Schema = GetFieldValue("Db2Schema");" & @CRLF & _
"" & @CRLF & _
" DoTest(TestFinancialSequence);" & @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