Write an expression or perl script to identify the entered
ip address is valid or not?

Answer Posted / digesh patel

if($ipaddress=~m\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)
print "\n It is a valid IP address :";

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use CGI?

2116


List the prefix dereferencer in Perl.

570


Why does Perl not have overloaded functions?

537


You want to concatenate strings with perl. How would you do that?

478


What are hashes?

540






what is perl language?

513


Write the program to process a list of numbers.

504


What is the main function of cookie server?

529


How to read a directory in perl?

534


How to add elements in a hash in perl?

513


you are required to replace a char in a string and store the number of replacements. How would you do that?

517


Explain different types of perl operators.

542


How to copy a file in perl?

516


Explain perl one-liner?

517


What is the difference between use and require in perl?

474