Private Function Pf_IsIP(Arg_Value As Variant) As Boolean
Dim RegEx As Object
Set RegEx = CreateObject("vbscript.regexp")
RegEx.Global = True
'IPV4
RegEx.Pattern = "^(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])$"
If Not (RegEx.Test(Arg_Value)) Then
'IPV6
RegEx.Pattern = "([0-9a-fA-F]{4}:){7}[0-9a-fA-F]{4}"
If Not (RegEx.Test(Arg_Value)) Then
Pf_IsIP = False
Exit Function
End If
End If
Pf_IsIP = True
End Function
Dim RegEx As Object
Set RegEx = CreateObject("vbscript.regexp")
RegEx.Global = True
'IPV4
RegEx.Pattern = "^(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])/.(/d{1,2}|1/d/d|2[0-4]/d|25[0-5])$"
If Not (RegEx.Test(Arg_Value)) Then
'IPV6
RegEx.Pattern = "([0-9a-fA-F]{4}:){7}[0-9a-fA-F]{4}"
If Not (RegEx.Test(Arg_Value)) Then
Pf_IsIP = False
Exit Function
End If
End If
Pf_IsIP = True
End Function