Spesso ci si trova nella necessità di ricercare complessi pattern Regexp per convalidare un indirizzo IP.

In realtà c’è un metodo molto più semplice e molto .NETish

Public Shared Function IsValidIP(ByVal address As String) As Boolean

Dim IpAddress As System.Net.IPAddress = Nothing

If System.Net.IPAddress.TryParse(address, IpAddress) Then
Return True
End If

Return False

End Function