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

What do you mean by context of a subroutine?

922


How to know whether a key exists or not in perl?

917


Explain '->' in perl?

873


Explain arrays in perl.

882


Which operator in perl is used for the concatenation of two strings?

951


How are parameters passed to subroutines in perl?

890


What is the use of now constructor in perl?

911


What are the reasons that cookie server can’t handle multiple connections?

905


What package you use to create a windows services?

833


Explain goto label?

868


How will you create a file in perl?

920


How to read a single line from a file in perl?

923


What is Perl?

949


What is perl I used for?

905


What is the difference between single (') and double (") quote in a string in perl?

907