#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\b(?:(?:0?[0-9]?[0-9]|1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.??\b){4}"
Local $sString = "Should Match:" & @CRLF & _
"204.131.100.104" & @CRLF & _
"255.255.005.055" & @CRLF & _
"192.168.10.1" & @CRLF & _
"172.16.1.1" & @CRLF & _
"10.10.10.1" & @CRLF & _
"1.2.3.4" & @CRLF & _
"255.255.255.255" & @CRLF & _
"001.02.3.004" & @CRLF & _
"123.145.254.189:8080" & @CRLF & _
"1.2.3.4-4.3.20.1" & @CRLF & _
"4.3.2.1.9.8.7.6" & @CRLF & _
"Shouldnt match:" & @CRLF & _
"255.256.255.255" & @CRLF & _
"172.999.2.3" & @CRLF & _
"this is a string1.2.3.4" & @CRLF & _
"this is another 1.2.3.4string" & @CRLF & _
"144.109.279.255" & @CRLF & _
"v1.2.3.4" & @CRLF & _
""
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