Write a simple regular expression to match an IP address,
e-mail address, city-state-zipcode combination.

Answer Posted / anshuman

/^([1-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/



All those above answer are wrong...because all of them take

0.0.0.0 as valid IP address which is not the case...with computer science ...

Developed By Anshuman sengupta

Reviewed by Arnab Bose

Tested by Avishek chatterjee

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write syntax to use grep function?

550


How do I do fill_in_the_blank for each file in a directory?

546


How to read multi lines from a file in perl?

515


Explain splicing of arrays?

526


What are the various perl data types based on the context?

535






Explain the difference between declarations of 'my' and 'local' variable scope in perl?

504


What is the importance of perl warnings?

539


How many loop control keywords are there in perl?

557


how to extract pin_code,phone_number,year from text file using regular expressions in perl

1847


What is a chop() function in perl?

575


Who created perl?

529


Explain cpan?

534


What is the difference between use and require in perl?

474


How do you find the length of an array?

554


How do you you check the return code of a command in perl?

587