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
What is the importance of perl warnings? How do you turn them on?
What is it meants by '$_'?
“Perl regular expressions match the longest string possible”. What is the name of this match?
Create a function that is only available inside the scope where it is defined ?
Explain chop?
Explain perl.
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
what is the function of Return Value?
Explain grooving and shortening of arrays and splicing of arrays?
Explain grooving and shortening of arrays?
How we can navigate the xml documents?
How can arrays be tied?
Explain the default scope of variables in perl?
What are the various uses of perl?
How to connect to SQL server through Perl?