#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)([+]\d{1,2}|(00)\d{2,4}|\d{2})( [(]\d{1,3}[)])?[-. \/]?\d{2,6}?[-. \/]?\d{2,15}([-. \/]{1,3}\d{1,5}){0,4}"
Local $sString = "+49 40 123456-0" & @CRLF & _
"+49 40 123456 -0" & @CRLF & _
"+49 40 123456- 0" & @CRLF & _
"0049 40 123456-0" & @CRLF & _
"49 40 3339760" & @CRLF & _
"+49 151 1234 56 78" & @CRLF & _
"+49 40123456 - 282" & @CRLF & _
"+49 40 123 456 -282" & @CRLF & _
"0049 40 123 456 -282" & @CRLF & _
"+49 40 123456 - 282" & @CRLF & _
"+49 (0)40 123456-282" & @CRLF & _
"+49 (0) 40 123456 -282" & @CRLF & _
"+49 (0) 40 12 34 56 -282" & @CRLF & _
"0049 (0) 40 123456 -282" & @CRLF & _
"49 (0) 40 123456 -282" & @CRLF & _
"+4940123456282" & @CRLF & _
"0049401234560" & @CRLF & _
"+1-234-567-8901" & @CRLF & _
"+61-234-567-89-01" & @CRLF & _
"+46-234 5678901" & @CRLF & _
"+1 (234) 56 89 901" & @CRLF & _
"+1 (234) 56-89 901" & @CRLF & _
"+46.234.567.8901" & @CRLF & _
"+1/234/567/8901" & @CRLF & _
"Wenn man mich fragen würde, ob ich unter der +49 40 123456 282 erreichbar bin, würde ich sagen. "JA""
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