#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:(?:[\s-]*\d{2}-\d{2}-\d{4})+)?\s*(?<amount>-*\d+,\d+)\s*$"
Local $sString = " 31-12-2019 Forfait 01-01-2019 - 31-12-2019 -29,00 " & @CRLF & _
"31-12-2019Forfait 01-01-2019 - 31-12-201950,00" & @CRLF & _
"31-12-2019Mercedes-500,00" & @CRLF & _
"31-12-2019Client10 700,00" & @CRLF & _
"31-12-2019Comptoir17 50,00" & @CRLF & _
"" & @CRLF & _
"// edge cases" & @CRLF & _
"31-12-2019Client 10700,00" & @CRLF & _
"31-12-2019Client 10-700,00" & @CRLF & _
"31-12-2019Client 10 700,00" & @CRLF & _
"31-12-2019Comptoir 1750,00" & @CRLF & _
"31-12-2019Comptoir 17-50,00" & @CRLF & _
"31-12-2019Comptoir 17 50,00" & @CRLF & _
"" & @CRLF & _
"// versions related to [https://regex101.com/r/7TdghZ/1] ..." & @CRLF & _
"" & @CRLF & _
"^\s*(?<date>\d{2}-\d{2}-\d{4})\s*(?<text>[^\s-]+(?:(?:[\s-]*\d{2}-\d{2}-\d{4})+)?)\s*(?<amount>-*\d+,\d+)" & @CRLF & _
"" & @CRLF & _
"(?<date>\d{2}-\d{2}-\d{4})\s*(?<text>[^\s-]+(?:(?:[\s-]*\d{2}-\d{2}-\d{4})+)?)\s*(?<amount>-*\d+,\d+)\s*$" & @CRLF & _
"" & @CRLF & _
"// final version" & @CRLF & _
"(?:(?:[\s-]*\d{2}-\d{2}-\d{4})+)?\s*(?<amount>-*\d+,\d+)\s*$" & @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