Check if a string is an IP address