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 we
Just a warning about using System.Net.IpAddress.TryParse():
If you pass it an string containing an integer (e.g. "3") the TryParse function will convert it to "0.0.0.3" and, therefore, a valid InterNetworkV4 address. So, at the very least, the reformatted "0.0.0.3" should be returned to the user application so the user knows how their input was interpreted.