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 script for 'count the no.of digits using regular
expressions in perl..

Answer Posted / rajendran

($test,$number) = ("","");
$test = "12344tyyyyy456";
@test=split('',$test);
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find the length of an array in perl?

1026


What are the options that can be used to avoid logic errors in perl?

958


Define print() function in perl?

918


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

988


How to start perl in interactive mode?

1061


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

925


How does polymorphism work in perl?

922


What does perl do in linux?

950


How will you open a file in read-only mode in perl?

909


What is “grep” function in perl?

1007


What are the functions that can be performed using cgi program?

936


What is the function of virtual documents in cgi programs?

967


What are the advantages of perl programming?

998


How do I replace every character in a file with a comma?

991


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

894