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
How to convert arrays into a string in perl?
What are the different instances used in cgi overhead?
What is the difference between single (') and double (") quote in a string in perl?
What is qq (double q)operator in perl?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
What is use of ‘->’ symbol?
Mention how many ways you can express string in Perl?
What is Perl?
What are arrays in perl?
Does Perl have objects? If yes, then does it force you to use objects? If no, then why?
How to change a directory in perl?
Demonstrate subroutines in perl with a simple example.
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
What are the features of perl language?
How to find the length of an array in perl?