#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?!.*(?: |^)(?:\+\d|0)(?:[()-]*\d){6,}(?!\S)).*"
Local $sString = "abcd1234567" & @CRLF & _
"" & @CRLF & _
"1234567" & @CRLF & _
"123-4567" & @CRLF & _
"02221234567" & @CRLF & _
"0222-1234567" & @CRLF & _
"+862221234567" & @CRLF & _
"+86-222-123-4567" & @CRLF & _
"+86(222)1234567" & @CRLF & _
"86-222-1234567" & @CRLF & _
"" & @CRLF & _
"r 1234567 er " & @CRLF & _
" e 123-4567 e" & @CRLF & _
"ewq 02221234567 qw" & @CRLF & _
"2312 0222-1234567 232" & @CRLF & _
"we +862221234567 23" & @CRLF & _
"231 +86-222-123-4567 ewe" & @CRLF & _
",,,, +86(222)1234567 sss" & @CRLF & _
"ff 86-222-1234567 dd" & @CRLF & _
"" & @CRLF & _
"Some string here with no phone number" & @CRLF & _
"" & @CRLF & _
"a number with 7 and more digits is input" & @CRLF & _
"and it starts with 0 or + symbols" & @CRLF & _
"and could contain optional symbols "-", "(" and ")"" & @CRLF & _
"also enforce whitespace boundaries"
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