Write a script for 'count the no.of digits using regular
expressions in perl..

Answer Posted / santha

$testnumber='34535sssss24';
$numbercount=0;
while($testnumber=~m{\d}igs)
{
$numbercount++;
}
print "\n $numbercount";

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of ‘->’ symbol?

529


What is an interpolation in perl?

559


how to connect cisco switch uisng perl script

3377


You want to connect to sql server through perl. How would you do that?

540


Why aren't Perl's patterns regular expressions?

591






Which operator in perl is used for the concatenation of two strings?

492


Difference between the variables in which chomp function work ?

604


What is chomp() operator/function?

563


How will you access an element of a perl array?

514


what is Chop & Chomp function does?

593


Give an example of the -i and 0s option usage.

467


How to copy a file in perl?

510


Can you add two arrays together?

525


Explain perl. When do you use perl for programming?

446


Does Perl have objects? If yes, then does it force you to use objects? If no, then why?

545