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 / arun janardhanan

Simple guys here we go :-).........


#!/usr/bin/perl -w

use strict;
my($test,$number) = ("","");
$test = "12344tyyyyy456";
$number = ($test =~ tr/[0-9]/[0-9]/);
print "Number of digits in variable is :- $number ";
exit;

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

945


explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

862


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

911


What is perl dbi?

886


what is the function that is used to identify how many characters are there in a string?

956


How will you access an element of a perl array?

939


What is Perl?

998


Define operators used in perl?

933


What is the difference between die and exit in perl?

991


Explain join function in perl?

951


Explain regular expression in perl?

952


You want to download the contents of a url with perl. How would you do that?

867


Explain the different types of data perl can handle.

892


How to concatenate strings with perl?

857


What syntax is used for grep() function?

1164