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
Explain socket programming in perl?
What does -> symbol indicates in Perl?
Explain about the applications of perl?
Perl regular expressions are greedy" what does this mean?
How to concatenate strings in perl?
“Perl regular expressions match the longest string possible”. What is the name of this match?
What is it meants by '$_'?
Explain goto label, goto name, and goto expr?
How do I replace every character in a file with a comma?
What is the difference between single (') and double (") quote in a string in perl?
What does `$result = f() .. g()' really return?
How to copy a file in perl?
what are the three groups involved in information sharing?
How many types of variable in perl?
How can you use Perl warnings and what is the importance to use them?