#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)<([\w_-]*)>.*?<(\/\1)>"
Local $sString = "irgend ein Text" & @CRLF & _
"" & @CRLF & _
"der überlesen wird" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"<determination>" & @CRLF & _
" <title>Sport-Radfahren" & @CRLF & _
" </title>" & @CRLF & _
" <date>20.04.2022" & @CRLF & _
" </date>" & @CRLF & _
" <abstract>Da findet (vielleicht) der R(h)einflach statt." & @CRLF & _
" </abstract>" & @CRLF & _
"</determination>" & @CRLF & _
"" & @CRLF & _
"und zwischen 2 XML Fragmenten wieder Text." & @CRLF & _
"und noch ein wenig" & @CRLF & _
"" & @CRLF & _
" <detMin1-2>" & @CRLF & _
" <title>Sport-Schwimmen" & @CRLF & _
" </title>" & @CRLF & _
" <date>01.05.2022" & @CRLF & _
" </date>" & @CRLF & _
" <abstract>Eröffnung der Freischwimm Saison im Lambsheimer Weiher?" & @CRLF & _
" </abstract>" & @CRLF & _
" </detMin1-2>" & @CRLF & _
"" & @CRLF & _
"und auch text danach" & @CRLF & _
"" & @CRLF & _
"blablabla" & @CRLF & _
"" & @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