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 to print escaping characters inside a string in perl?
How to access parameters passed to a subroutine in perl?
What is perl dbi?
Explain what is STDIN, STDOUT and STDERR?
what are prefix dereferencer and list them out?
Enlist the advantages of using c over perl?
Explain the functioning of conditional structures in perl.
What are the arguments and what do they mean in perl programming?
How to replace perl array elements?
What $! In perl?
There are two types of eval statements i.e. Eval expr and eval block. Explain them.
Explain perl.
How to compare two strings in perl?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
What is the difference between exec and system?