#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?=.{10,15}$)(?=.*(?:.*\d){10}.*$)([\(\)\p{Zs}.-]*[0-9]{3}[\(\)\p{Zs}.-]*[0-9]{3}[\(\)\p{Zs}.-]*[0-9]{4})$"
Local $sString = "(501) 555 1234" & @CRLF & _
"(501)-555.1234" & @CRLF & _
"501-555-1234" & @CRLF & _
"501.555.1234" & @CRLF & _
"501 555 1234" & @CRLF & _
"501) 343-2233" & @CRLF & _
"(501 343-2233" & @CRLF & _
"(501. 343-2233" & @CRLF & _
"5013432233" & @CRLF & _
"800-..555-1234" & @CRLF & _
"(.8005551234" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"*-(.8005551234" & @CRLF & _
"501*555-1234" & @CRLF & _
"-(.80055512 41" & @CRLF & _
"501_555_1234" & @CRLF & _
"555-1234" & @CRLF & _
"800-...........555-1234" & @CRLF & _
"013432233" & @CRLF & _
"" & @CRLF & _
" 1. The string must be 10-15 total characters in length." & @CRLF & _
" 2. Must contain exactly 10 digits within string." & @CRLF & _
" 3. Can contain "(", ")" , " ", ".", or "-" delimiters within the string." & @CRLF & _
" 4. It doesn't matter how many delimiters are grouped as long as numbers are grouped in {3}{3}{4}."
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