#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[\s-]"
Local $sString = "91-011-23413627" & @CRLF & _
"21 011 23412331" & @CRLF & _
"91-22-5767801" & @CRLF & _
"91-22-5767801" & @CRLF & _
"31-424-2339056" & @CRLF & _
"91-731-2530659" & @CRLF & _
"92-731-2431956" & @CRLF & _
"1-731-2530659111" & @CRLF & _
"91-731-2431956" & @CRLF & _
"111 739 2530659111" & @CRLF & _
"091-011-23413627" & @CRLF & _
"121 011 23412331" & @CRLF & _
"291-322-5767801" & @CRLF & _
"491-22-5767801" & @CRLF & _
"531-424-2339056123" & @CRLF & _
"291-731-2530659123" & @CRLF & _
"192-731-2431956" & @CRLF & _
"122-731-2530659111" & @CRLF & _
"912-731-2431956{-truncated-}"
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