#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\[?(?:(?:(?:0000:){5}|::)ffff:|fe80:(?:(?:0000:){3}|:))?((?:\w{1,4}[:.]){0,3}\w{1,4}|[\w:.]*)"
Local $sString = "2600::1" & @CRLF & _
"2001:db8:0:0:1:0:0:1" & @CRLF & _
"2001:db8:85a3::8a2e:370:7334" & @CRLF & _
"[2001:db8:85a3::8a2e:370:7334]" & @CRLF & _
"5cc:1d47:39bf:3b52:593d:633e:f045:3ec4" & @CRLF & _
"5cc:1d47:39bf:3b52::1" & @CRLF & _
"192.168.1.1" & @CRLF & _
"0.0.0.0" & @CRLF & _
"255.255.255.255" & @CRLF & _
"[0000:0000:0000:0000:0000:ffff:255.255.255.255]" & @CRLF & _
"::ffff:255.255.255.255" & @CRLF & _
"fe80::593d:633e:f045:3ec4" & @CRLF & _
"fe80:0000:0000:0000:593d:633e:f045:3ec4" & @CRLF & _
"::1" & @CRLF & _
"0:0:0:0:0:0:0:1"
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