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 an expression or perl script to identify the entered
ip address is valid or not?

Answer Posted / subhash chandran

if($IP !~ /(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|
[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))/)
{
print "Valid\n";
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"

2398


What is use of ‘->’ symbol?

1009


How to deleting an existing file in perl programming?

911


We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

2481


How do you find the length of an array?

977


Explain socket programming in perl?

917


What does redo statement do in perl?

1047


Give an example of the -i and 0s option usage.

900


Explain subroutine?

923


What is q (single q) operator in perl?

1094


What rules must be followed by modules in perl.

992


How to close a file in perl?

952


Give an example of using the -n and -p option.

1005


How do you you check the return code of a command in perl?

985


how to extract pin_code,phone_number,year from text file using regular expressions in perl

2237