Write a simple regular expression to match an IP address,
e-mail address, city-state-zipcode combination.
Answer Posted / treddy
Hi all,
Here is the regular expression for matching the valid ip
address.
^(25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})[.](25[0-5]|2[0-4]{0,1}[0-9]{0,1}|1[0-9]{1,2}|[0-9]{1,2})$
Let me know your comments.
Thanks,
TReddy
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you turn on the perl warnings?
Explain the execution of a program in perl.
How to remove a directory in perl?
Give an example of using the -n and -p option.
What are the various flags/arguments that can be used while executing a perl program?
what is Polymorphism in Perl?
How do you you check the return code of a command in perl?
Explain the difference between "my" and "local" variable scope declarations. ?
How many loop control keywords are there in perl?
How to change a directory in perl?
Where do we require ‘chomp’ and what does it mean?
How many data types are there in perl?
How and what are closures implemented in perl?
Explain use of ‘my’ keyword in perl?
What does the qq{ } operator do?