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

Mention the difference between die and exit in Perl?

1168


What is perl pop array function?

997


Why to use perl?

994


Why aren't Perl's patterns regular expressions?

1244


What does init 5 and init 0 do?

1067


what are steps to do to lock the sony ericsson mobile with password?

2246


What are different data types that perl supports. Elaborate on them.

1170


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

1012


You want to open and read data files with perl. How would you do that?

921


Explain subroutine in perl?

1003


How can information be put into hashes?

1025


What are the purpose of close(), getc() and read() functions?

923


Explain chop?

963


What does the qq{ } operator do?

1007


What are stdin, stdout and stderr?

1202