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
Why aren't Perl's patterns regular expressions?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
How to read a file into a hash array?
What does perl do in linux?
Which operator in perl is used for the concatenation of two strings?
What is perl? What is the basic command to print a string in perl?
what is the difference between java and cgi?
How can memory be managed in Perl?
Differentiate between use and require, my and local, for and foreach and exec and system
Differentiate use and require?
What is subroutine in perl?
How to concatenate strings in perl?
Can you add two arrays together?
Write an example explaining the use of symbol tables.
What are prefix dereferencer?