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
What does the q{ } operator do?
Explain gmtime() function in perl?
You want to download the contents of a url with perl. How would you do that?
What is the use of "stderr()"?
How do I pass a command line argument in perl?
How to convert strings into an array in perl?
Explain which feature of PERL provides code reusability?
What are the various advantages and disadvantages of perl?
What are hashes?
How can memory be managed in Perl?
Why to use perl scripting?
What is perl pop array function?
In Perl, what is grep function used for?
How do I replace every character in a file with a comma?
What does next statement do in perl?