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 / anandan

#!/usr/bin/perl -w

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

Is This Answer Correct ?    5 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you set environment variables in perl?

1106


Explain perl. When do you use perl for programming?

917


You want to read command-line arguements with perl. How would you do that?

950


Differentiate between c++ and perl.

1053


what is Polymorphism in Perl?

1018


What is perl I used for?

1002


Explain string comparison operators in perl.

1054


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

1034


Differentiate between arrays and list in perl.

1032


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

1174


What is the different between array and hash in perl programming?

990


What is goto statement in perl?

981


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

1005


Difference between the variables in which chomp function work ?

1117


Explain perl one-liner?

998