#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)^(?<srcNet>\d{1,3}\.\d{1,3}\.\d{1,3}|[0-9a-f]{1,4}:[0-9a-f]{1,4}:[0-9a-f]{1,4}:[0-9a-f]{1,4})[.:]"
Local $sString = "218.65.30.30" & @CRLF & _
"218.65.30.107" & @CRLF & _
"58.218.198.172" & @CRLF & _
"2001:468:1900::34" & @CRLF & _
"2001:468:4043:6343:1011:6604:3200:2883" & @CRLF & _
"::1" & @CRLF & _
"2001:0468:1900:1010:4030:3898:3021:aabC" & @CRLF & _
"103.3022.349.349" & @CRLF & _
".1" & @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