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
Write syntax to use grep function?
How do I do fill_in_the_blank for each file in a directory?
How to read multi lines from a file in perl?
Explain splicing of arrays?
What are the various perl data types based on the context?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
What is the importance of perl warnings?
How many loop control keywords are there in perl?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
What is a chop() function in perl?
Who created perl?
Explain cpan?
What is the difference between use and require in perl?
How do you find the length of an array?
How do you you check the return code of a command in perl?