Write a script for 'count the no.of digits using regular
expressions in perl..
Answer Posted / rajendran
($test,$number) = ("","");
$test = "12344tyyyyy456";
@test=split('',$test);
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;
| Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
Mention the difference between die and exit in Perl?
What is perl pop array function?
Why to use perl?
Why aren't Perl's patterns regular expressions?
What does init 5 and init 0 do?
what are steps to do to lock the sony ericsson mobile with password?
What are different data types that perl supports. Elaborate on them.
How to read a single line from a file in perl?
You want to open and read data files with perl. How would you do that?
Explain subroutine in perl?
How can information be put into hashes?
What are the purpose of close(), getc() and read() functions?
Explain chop?
What does the qq{ } operator do?
What are stdin, stdout and stderr?