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
What does 'do' statement do in perl?
Explain the difference between "my" and "local" variable scope declarations. ?
What are the various flags/arguments that can be used while executing a perl program?
What are the two ways to get private values inside a subroutine?
Explain goto label?
How do I sort a hash by the hash value?
Write the program to process a list of numbers.
How do you find the length of an array?
How to dereference a reference?
How do you set environment variables in perl?
what is CPAN?
How to remove a directory in perl?
What are the various advantages and disadvantages of perl?
Explain the meaning of closure in perl.
Comment on data types and variables in perl.