#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?u)(?mi)Address\h+(\w+)\h+(\w+)\n\h*(\d+ \w+) (\w+) (\w+)\n(?:Phone\h+(.+)\n)?(?:Website\h+(.+)\n)?lat\. long\.\h+(.+)"
Local $sString = "Address Slangenburg 13" & @CRLF & _
" 7608 RS Almelo Nederland" & @CRLF & _
"lat. long. 52.376536, 6.691050" & @CRLF & _
"" & @CRLF & _
"Address Westeinde 26" & @CRLF & _
" 1017 ZP Amsterdam Nederland" & @CRLF & _
"Phone +31 20 523 1030" & @CRLF & _
"Website https://www.Amsterdam.nl" & @CRLF & _
"lat. long. 52.359401, 4.898580"
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