#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^[A-Z-0-9]+ .*(?<type>chore|ci|docs|feat|fix|perf|refactor|revert|style|test|¯\\_\(ツ\)_\/¯)(?<scope>\(\w+\)?((?=:\s)|(?=!:\s)))?(?<breaking>!)?(?<subject>:\s.*)?|^(?<merge>Merge.* \w+)|^(?<revert>Revert.* \w+)"
Local $sString = "### Should Pass Test" & @CRLF & _
"" & @CRLF & _
"NV-1234 chore: change build progress" & @CRLF & _
"DT-123456 docs: update xdemo usage" & @CRLF & _
"QA-123 ci: update jenkins automatic backup" & @CRLF & _
"CC-1234 feat: new fucntional about sync" & @CRLF & _
"Merge branch master into develop" & @CRLF & _
"Reverted: Revert "support UV113 feature & bugfix branches make full build" & @CRLF & _
"Merge pull request #36 in cicd from test to developSquashed commit of the following: com" & @CRLF & _
"" & @CRLF & _
"### Failed to match test" & @CRLF & _
"NV-1234 build: update " & @CRLF & _
"NV-1234 Chore: change progress" & @CRLF & _
"DT-123456 Docs: update xdemo" & @CRLF & _
"QA-123ci: update jenkins automatic backup" & @CRLF & _
"CC-1234 Feat: new fucntional about sync" & @CRLF & _
"DT-17734: 8.2.2 merge from CF1/2- Enhance PORT.STATUS to identify Python processes initiated" & @CRLF & _
"DT-17636 fix AIX cord dump issue" & @CRLF & _
"DT-18183 Fix the UDTHOME problem for secure telnet" & @CRLF & _
"DT-18183 Add new condition to get UDTHOME" & @CRLF & _
"DT-15567 code merge by Peter Shen."
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