I know regex is dangerous for validating IP addresses because of the different forms an IP address can take.
I've seen similar questions for C and C++, and those were resolved with a function that doesn't exist in C# inet_ntop()
The .NET solutions I've found only handle the standard "ddd.ddd.ddd.ddd" form. Any suggestions?
If you don't want to parse every integer, but only IPs, just check
.
for IPv4 and:
for IPv6.