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
Explain lexical variables.
how to get back up from private character editor which is saved in the format of .udf
What is the syntax used in Perl grep function?
What $! In perl?
How to know whether a key exists or not in perl?
How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?
What does theβ$_β symbol mean?
What is use of β->β symbol?
What is the difference between die and exit in perl?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
Explain USE and REQUIREMENT statements?
What is the different between array and hash in perl programming?
Explain goto label, goto name, and goto expr?
what are the two ways to get private values inside a subroutine or block?
What does this symbol mean '->'?