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

What does next statement do in perl?

993


How does polymorphism work in perl? Give an example.

869


Explain the execution of a program in perl.

993


How to open and read data files with Perl

1051


What are the advantages of c over Perl?

937


What does 'do' statement do in perl?

997


Explain split function in perl?

995


What are scalars in perl?

964


How to read a file into a hash array?

1044


What is goto statement in perl?

940


you are required to replace a char in a string and store the number of replacements. How would you do that?

924


How to close a file in perl?

947


There are some duplicate entries in an array and you want to remove them. How would you do that?

911


How do I generate a list of all .html files in a directory?

956


In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?

908