Check whether a string is a valid phone number.