title: Validate IPv4, IPv6 and hostname
body: <p>I'm working on a project in .net , that can connect to different machines by an IP address that the user inputs.<br>
  I'm trying to validate the inputted IP Address using a regular expression. I've searched the internet for some time now, and i cannot get a proper regex.  </p>
  
  <p>I've wrote a little program to test the regex, see <a href="http://jsfiddle.net/DanielD/8S4nq/">here</a>,(the IP addresses were generated randomly, I'm sorry if some of the IP Addresse belongs to someone)</p>
  
  <p>Can you help me find a viable solution, in validating on client side the user input ?! (it can be an IPv4, IPv6 or hostname, the port is not included in the address) </p>
  
  <p>Thanks.</p>