Validate IP in a string