Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which has the highest precedence, List or Terms? Explain?

891


Which has highest precedence in between list and terms? Explain?

867


How do I debug a perl program?

990


What are some common methods to all handles in perl?

923


What are the different ways to run cgi?

960


Explain the various characteristics of perl.

960


What is perl scripting?

946


Can inheritance be used in perl?

999


Explain the default scope of variables in perl?

945


Explain splicing of arrays?

920


Explain perl one-liner?

960


What are prefix dereferencer? List them.

976


What is stdin in perl?

968


Why is it hard to call this function: sub y { "because" } ?

962


You want to add two arrays together. How would you do that?

881