#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(RSUINTREL-[0-9]+\s+|PANGUSW-[0-9]+\s+|APRICOT-[0-9]+\s+|GEN6PANGU-[0-9]+\s+|SWFCN-[0-9]+\s+)+.*$"
Local $sString = "### Should Pass Test" & @CRLF & _
"" & @CRLF & _
"SWFCN-287 debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"SWFCN-287 APRICOT-9999 SWFCN-0000 debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"APRICOT-287 debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"SWFCN-287 debug 222 test test test !!!!" & @CRLF & _
"GEN6PANGU-1111 Add gitlab ci" & @CRLF & _
"RSUINTREL-957 add test message" & @CRLF & _
"" & @CRLF & _
"### Failed to match test" & @CRLF & _
"" & @CRLF & _
"SWFCN-2a7 debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"SWFCN-287APRICOT-9999 SWFCN-0000 debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"debug CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" & @CRLF & _
"" & @CRLF & _
"" & @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