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 convert arrays into a string in perl?

991


What are the different instances used in cgi overhead?

1038


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

1110


What is qq (double q)operator in perl?

1062


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

1041


What is use of ‘->’ symbol?

1058


Mention how many ways you can express string in Perl?

1076


What is Perl?

1055


What are arrays in perl?

1019


Does Perl have objects? If yes, then does it force you to use objects? If no, then why?

1027


How to change a directory in perl?

983


Demonstrate subroutines in perl with a simple example.

919


Which functions in Perl allows you to include a module file or a module and what is the difference between them?

1095


What are the features of perl language?

1149


How to find the length of an array in perl?

1061