#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "Author:\s*(?<name>.+)\s+Date:\s*(?<date>.+)\s+(?<message>(?:(?!commit .{40}).)+)"
Local $sString = "commit 11ae9c97409fb349e2bfa50ed65bd23ec6dbca70" & @CRLF & _
"Author: Fabien Potencier <fabien.potencier@gmail.com>" & @CRLF & _
"Date: Wed Jul 11 19:51:30 2012 +0200" & @CRLF & _
"" & @CRLF & _
" updated VERSION for 2.0.16" & @CRLF & _
"" & @CRLF & _
"commit 6e14d67cb23439d6700f494e29e809811edeeade" & @CRLF & _
"Author: Fabien Potencier <fabien.potencier@gmail.com>" & @CRLF & _
"Date: Wed Jul 11 19:50:55 2012 +0200" & @CRLF & _
"" & @CRLF & _
" update CONTRIBUTORS for 2.0.16" & @CRLF & _
"" & @CRLF & _
"commit 0341492ed566fca8df556573b9664f691c5dff3d" & @CRLF & _
"Author: Fabien Potencier <fabien.potencier@gmail.com>" & @CRLF & _
"Date: Wed Jul 11 19:48:12 2012 +0200" & @CRLF & _
"" & @CRLF & _
" updated CHANGELOG for 2.0.16" & @CRLF & _
"" & @CRLF & _
"commit b18f6f557b5db1e2e6d2c2c0494e0564b91f438d" & @CRLF & _
"Author: Fabien Potencier <fabien.potencier@gmail.com>" & @CRLF & _
"Date: Tue Jul 10 15:28:02 2012 +0200" & @CRLF & _
"" & @CRLF & _
" [Console] fixed wrong phpdoc (closes #4394)" & @CRLF & _
"" & @CRLF & _
" Match This line"
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