Jan-02-2017, 09:03 AM
Hello guys,
In this program i need to check whether the given ip is valid or not?
What is the mistake here?
In this program i need to check whether the given ip is valid or not?
print "Enter the IP:" save=raw_input() regex="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" if save in regex: print "Valid ip" else: print "invalid ip"i got nothing as my output
What is the mistake here?