#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)^(\s*\+?\-?([\s0-9\s]{2,4}\s*)?\s*)\s*\(?([\s0-9\s]{3})\)?[-. ]?(\s*[\s0-9\s]{3}\s*)[-. ]?(\s*[\s0-9\s]{4,7}\s*)(\s*)$"
Local $sString = "+4487497892782" & @CRLF & _
"0043847352892" & @CRLF & _
"+4487-497892782" & @CRLF & _
"" & @CRLF & _
"+4487497892782" & @CRLF & _
"+4487497892782" & @CRLF & _
"+44 8975482979" & @CRLF & _
"+44 8975482979" & @CRLF & _
" +44 8975482979" & @CRLF & _
"+44 8975482979" & @CRLF & _
" +448975482979 " & @CRLF & _
" +4489754 82979 " & @CRLF & _
" +4489 7 5 4 8 2 9 7 9 " & @CRLF & _
" +44 89 7 5 4 8 2 9 7 9 " & @CRLF & _
"+074-774-8292" & @CRLF & _
"074-774-8292" & @CRLF & _
"(074)-774-8292" & @CRLF & _
"004507477485" & @CRLF & _
"+4474-774.8292" & @CRLF & _
"" & @CRLF & _
"(\s*\+?\s*([0-9][\s-]*){9,})"
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