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
Write syntax to use grep function?
Explain 'grep' function.
How do you give functions private variables that retain their values between calls?
In Perl, what is grep function used for?
Explain '->' in perl?
what are steps to do to lock the sony ericsson mobile with password?
You want to empty an array. How would you do that?
What's the difference between /^Foo/s and /^Foo/?
Explain the functioning of conditional structures in perl.
How do find the length of an array?
What can be done for efficient parameter passing in perl? Explain.
Create a function that is only available inside the scope where it is defined ?
How to concatenate strings in perl?
How to read a file into a hash array?
What are the advantages of programming in perl?