#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^((25[0-5]|2[0-4]\d|[01]?\d{1,2})\.){3}(25[0-5]|2[0-4]\d|[01]?\d{1,2})$"
Local $sString = "22.231.113.64" & @CRLF & _
"22.231.113.164" & @CRLF & _
"222.231.113.64" & @CRLF & _
"22.231.113.64" & @CRLF & _
"22.231.113.164" & @CRLF & _
"255.231.111.64" & @CRLF & _
"253.231.111.64" & @CRLF & _
"22.21.113.61" & @CRLF & _
"22.21.113.162" & @CRLF & _
"255.21.111.63" & @CRLF & _
"253.21.111.69" & @CRLF & _
"22.211.113.64" & @CRLF & _
"22.212.113.164" & @CRLF & _
"255.213.111.64" & @CRLF & _
"253.214.111.64" & @CRLF & _
"" & @CRLF & _
"22.211.113.364" & @CRLF & _
"22.212.113.3164" & @CRLF & _
"255.213.111.464" & @CRLF & _
"253.214.111.564" & @CRLF & _
"not an ip address" & @CRLF & _
"not an ipv4 Address" & @CRLF & _
"Not an IPv5 Address"
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