#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(\+7|[7,8]\ ?)(\d{10}|(\(?\d{3}\)?\ ?\d{3}[\-,\ ]?\d{2}[\-,\ ]?\d{2}))$"
Local $sString = "+79855310868" & @CRLF & _
"79855310868" & @CRLF & _
"7 985 531 08 68" & @CRLF & _
"+7(999)459-88-65" & @CRLF & _
"8 (999) 459-88-65" & @CRLF & _
"880084545454" & @CRLF & _
"88008454545411" & @CRLF & _
"465456465465" & @CRLF & _
"784545487878" & @CRLF & _
"12125465415646" & @CRLF & _
"454658498797894" & @CRLF & _
"231321546545" & @CRLF & _
"231321321316548" & @CRLF & _
"7889213554654" & @CRLF & _
"84456464641" & @CRLF & _
"89855310868"
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