Allow IP addresses as hostnames for JDBC

Ran into a problem trying to use 127.0.0.1 as a hostname. Turns out the regex isn't quite right.

Added specs to prove the bug.