#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\+97[\s]{0,1}[\-]{0,1}[\s]{0,1}1|0)50[\s]{0,1}[\-]{0,1}[\s]{0,1}[1-9]{1}[0-9]{6}"
Local $sString = "Matches (mobile)" & @CRLF & _
"+97150 3827741 | 0503827741 | 050-3827741" & @CRLF & _
"Non-Matches " & @CRLF & _
"040 3827741 | 05 3827741 | 050_______spaces_______3827741" & @CRLF & _
"" & @CRLF & _
"Matches (land)" & @CRLF & _
"04 3452488 | 04 -3452488 | 04 - 3452499" & @CRLF & _
"Non-Matches " & @CRLF & _
"01 -3452488 | 04 34524888 | 04 3452488" & @CRLF & _
"" & @CRLF & _
"Other tests" & @CRLF & _
"+97150 3827741 | +97150 3827741"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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