#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<date>\d{4}-\d{2}-\d{2}) (?<time>\d{2}_\d{2}_\d{2})(-| - )(?<window>.*?)(?<extension>\.(png|jpg|jpeg))"
Local $sString = "2017-08-31 18_57_42-HandBrake.png" & @CRLF & _
"2017-08-31 18_57_43-HandBrake.png" & @CRLF & _
"2017-08-31 18_57_42-HandBrake - Kopie.png" & @CRLF & _
"2017-08-31 18_57_42-HandBrake2.png" & @CRLF & _
"2019-03-09 11_11_09 - musicBee - 000003.png" & @CRLF & _
"should fail.png'"
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