#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(((?:\+|00)964)|(0)*)7\d{9}$"
Local $sString = "7701234567" & @CRLF & _
"770123456" & @CRLF & _
"77012345678" & @CRLF & _
"" & @CRLF & _
"07701234567" & @CRLF & _
"0770123456" & @CRLF & _
"077012345678" & @CRLF & _
"" & @CRLF & _
"+9647701234567" & @CRLF & _
"+964770123456" & @CRLF & _
"+96477012345678" & @CRLF & _
"" & @CRLF & _
"009647701234567" & @CRLF & _
"00964770123456" & @CRLF & _
"0096477012345678" & @CRLF & _
"" & @CRLF & _
"738479299372492" & @CRLF & _
"0770 123 4567"
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