Your regexp for IP's is flawed, I can enter 999.999.999.999, which obviously isn't a real IP. I found something similar to this in the Ram book (?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])\.?){4}
Disclaimer: I realize this may not be the most efficent regex, but it does work, right?
If you're on a UNIX machine, you could always use nmap