Why does IPAddress.TryParse allow anything after a ']'
- by Rawling
I'd like to use System.Net.IPAddress.TryParse to validate IPv6 addresses because I don't want to write my own reg exp :-)
However, this seems to allow strings such as "(validIPv6)](anythingatallhere)" - for example, "1234::5678:abcd]whargarbl".
Is there a reason for these being valid, or is this a fault?
This is further complicated by the fact that I actually want only strings of the form "[(validIPv6)]:(portnumber)" so I'm going to have to do a bit of validation myself.