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 next statement do in perl?
Explain the difference between die and exit in perl?
How do you give functions private variables that retain their values between calls?
Explain 'grep' function.
How to concatenate strings with perl?
Comment on array slicing and range operator
How to renaming a file in perl programming?
How do I replace every TAB character in a file with a comma?
Create a function that is only available inside the scope where it is defined ?
What does read () command do?
How do I generate a list of all .html files in a directory?
How to check the status of airplane mode (enable/disable) in perl for Android mobile?
what is Chop & Chomp function does?
What does the qx{ } operator do?
Explain what is STDIN, STDOUT and STDERR?