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 the importance of perl warnings? How do you turn them on?

541


What is it meants by '$_'?

532


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

527


Create a function that is only available inside the scope where it is defined ?

549


Explain chop?

534






Explain perl.

551


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

541


what is the function of Return Value?

561


Explain grooving and shortening of arrays and splicing of arrays?

498


Explain grooving and shortening of arrays?

700


How we can navigate the xml documents?

535


How can arrays be tied?

517


Explain the default scope of variables in perl?

510


What are the various uses of perl?

524


How to connect to SQL server through Perl?

561