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

Write a program to decode the data in the form using cgi programming

1054


what are the steps involved in reading a cgi script on the server?

948


How to read a directory in perl?

1045


Explain a tell function in perl?

975


Explain the arguments for perl interpreter.

1259


Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)

1009


“Perl regular expressions match the longest string possible”. What is the name of this match?

947


What are stdin, stdout and stderr?

1127


What are prefix dereferencer?

934


What is a chop() function in perl?

1022


What are the advantages and disadvantages of perl language?

919


Can you add two arrays together?

942


How to code in perl to implement the tail function in unix?

946


what are prefix dereferencer and list them out?

1044


What is 'rollback' command in perl?

964