#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)^(0|\+98)9[0-9]{9}$"
Local $sString = "09156987452" & @CRLF & _
"09908472853" & @CRLF & _
"09153610882365" & @CRLF & _
"09158645287" & @CRLF & _
"+9814756842" & @CRLF & _
"+980915874622" & @CRLF & _
"+989908472853" & @CRLF & _
"+981283547" & @CRLF & _
"9836587498" & @CRLF & _
"+986859554" & @CRLF & _
"+989158497858" & @CRLF & _
"+9812457868" & @CRLF & _
"02154091563214587" & @CRLF & _
"12409156032145" & @CRLF & _
"091596356478" & @CRLF & _
"+982654789652" & @CRLF & _
"023654d" & @CRLF & _
"5588" & @CRLF & _
"879 091586424569" & @CRLF & _
"+9878546" & @CRLF & _
"+9999999999999" & @CRLF & _
"+989153610883" & @CRLF & _
"0915603551555555555" & @CRLF & _
""
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