#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(\W|\s|\d|\w|\S)([7, 8][0-9]{10})"
Local $sString = "84951234567" & @CRLF & _
"+74951234567" & @CRLF & _
"8-495-1-234-567" & @CRLF & _
" 8 (8122) 56-56-56" & @CRLF & _
"8-911-1234567" & @CRLF & _
"8 (911) 12 345 67" & @CRLF & _
"8-911 12 345 67" & @CRLF & _
"8 (911) - 123 - 45 - 67" & @CRLF & _
"+ 7 999 123 4567" & @CRLF & _
"8 ( 999 ) 1234567" & @CRLF & _
"8 999 123 4567" & @CRLF & _
"" & @CRLF & _
"// выше - правильные, ниже - неправильные:" & @CRLF & _
"" & @CRLF & _
"02" & @CRLF & _
"84951234567 позвать люсю" & @CRLF & _
"849512345" & @CRLF & _
"849512345678" & @CRLF & _
"8 (409) 123-123-123" & @CRLF & _
"7900123467" & @CRLF & _
"5005005001" & @CRLF & _
"8888-8888-88" & @CRLF & _
"84951a234567" & @CRLF & _
"8495123456a" & @CRLF & _
"+1 234 5678901" & @CRLF & _
"+8 234 5678901" & @CRLF & _
"7 234 5678901" & @CRLF & _
""
Local $sSubst = ""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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