#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)\n(HORIZON-\S+-[A-Z]{1}\d{1}-\d{2})\s+"
Local $sString = "" & @CRLF & _
"HORIZON-CL5-2021-D1-01" & @CRLF & _
"Conditions for the Call" & @CRLF & _
"Indicative budget(s) " & @CRLF & _
"Topics Type of Action Budgets (EUR million) Expected EU contribution per project (EUR million) Number of projects expected to be funded" & @CRLF & _
" 2021 " & @CRLF & _
"Opening: 15 Apr 2021" & @CRLF & _
"Deadline(s): 07 Sep 2021" & @CRLF & _
"" & @CRLF & _
"HORIZON-CL5-2022-D1-01-two-stage" & @CRLF & _
"Conditions for the Call" & @CRLF & _
"Indicative budget(s) " & @CRLF & _
"Topics Type of Action Budgets (EUR million) Expected EU contribution per project (EUR million) Number of projects expected to be funded" & @CRLF & _
" 2022 " & @CRLF & _
"Opening: 04 Nov 2021" & @CRLF & _
"Deadline(s): 15 Feb 2022 (First Stage), 07 Sep 2022 (Second Stage)" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"HORIZON-CL5-2021-D2-01" & @CRLF & _
"Conditions for the Call" & @CRLF & _
"Indicative budget(s) " & @CRLF & _
"Topics Type of Action Budgets (EUR million) Expected EU contribution per project (EUR million) Number of projects expected to be funded" & @CRLF & _
" 2021 2022 " & @CRLF & _
"Opening: 15 Apr 2021" & @CRLF & _
"Deadline(s): 19 Oct 2021"
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