#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4}$|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})$"
Local $sString = "Valid:" & @CRLF & _
"1:2:3:4:5:6:7:8" & @CRLF & _
"1::" & @CRLF & _
"::1" & @CRLF & _
"2001:db8:3:4::192.0.2.33" & @CRLF & _
"64:ff9b::192.0.2.33" & @CRLF & _
"FEDC:BA98:7654:3210:FEDC:BA98:7654:3210" & @CRLF & _
"1080:0:0:0:8:800:200C:417A" & @CRLF & _
"0:0:0:0:0:0:0:1" & @CRLF & _
"::0:0:0:FFFF:129.144.52.38" & @CRLF & _
"FEDC:BA98::3210:FEDC:BA98:7654:3210" & @CRLF & _
"::13.1.68.3" & @CRLF & _
"" & @CRLF & _
"Invalid:" & @CRLF & _
"128.0.0.1" & @CRLF & _
"FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:AA31" & @CRLF & _
"" & @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