#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?|(((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}|(38\(026\)123-45-67)|\+380 123 45 67))$"
Local $sString = "+79261234567" & @CRLF & _
"89261234567" & @CRLF & _
"79261234 567" & @CRLF & _
"+380 123 45 67" & @CRLF & _
"38(026)123-45-67" & @CRLF & _
"9261234567" & @CRLF & _
"79261234567" & @CRLF & _
"(495)1234567" & @CRLF & _
"(495) 123 45 67" & @CRLF & _
"89261234567" & @CRLF & _
"8-926-123-45-67" & @CRLF & _
"8 927 1234 234" & @CRLF & _
"8 927 12 12 888" & @CRLF & _
"8 927 12 555 12" & @CRLF & _
"8 927 123 8 123" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Пример с условием" & @CRLF & _
"/(?|(candy)|(kiss)|(berry))/g" & @CRLF & _
"A candy, kiss, or even a berry is delicious." & @CRLF & _
"$1 =candykissberry "
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