Added code to further validate IP adresses

Added a new function running a regular expression on the string
containing the IP address