Write a simple regular expression to match an IP address,
e-mail address, city-state-zipcode combination.
Answer Posted / saravanan
$ip="0.25.55.25";
if($ip=~/([0-2]{0,1}[0-5]{0,2})\.([0-2]{0,1}[0-5]{0,2})\.([0-2]{0,1}[0-5]{0,2})\.([0-2]{0,1}[0-5]{0,2})/){
print $ip;
}
This will match for all ip address
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which has the highest precedence, List or Terms? Explain?
Which has highest precedence in between list and terms? Explain?
How do I debug a perl program?
What are some common methods to all handles in perl?
What are the different ways to run cgi?
Explain the various characteristics of perl.
What is perl scripting?
Can inheritance be used in perl?
Explain the default scope of variables in perl?
Explain splicing of arrays?
Explain perl one-liner?
What are prefix dereferencer? List them.
What is stdin in perl?
Why is it hard to call this function: sub y { "because" } ?
You want to add two arrays together. How would you do that?