check if a string is an ip address