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

What is perl? What is the basic command to print a string in perl?

832


What does cgi program store?

853


Differentiate between c++ and perl.

946


When do you use perl programming?

949


How will you get the count of parameters passed to a perl subroutine?

886


What is the difference between use and require in perl programming?

872


What is the use of –w?

871


Can we load binary extension dynamically?

889


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

839


What is the purpose of redo statement?

950


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

930


Comment on array slicing and range operator

901


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

980


Demonstrate subroutines in perl with a simple example.

819


Explain about the applications of perl?

914