Write a script for 'count the no.of digits using regular
expressions in perl..
Answer Posted / tclgeek
to find the count of no of digits using regular expression in TCL
set val "abbj68689kbj8798797"
set a [regexp {[a-z]+(\d+)[a-z]+(\d+)} $val val1 val2 val3]
if { $a == 1 } {
puts "matched pattern found are : $val2$val3"
puts "the number of digits are [expr [string length $val2] + [string length $val3]]"
} else {
puts "error"
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can inheritance be used in perl? Explain with the help of an example.
What does `$result = f() .. g()' really return?
How can the user execute a long command repeatedly without typing it again and again?
What is warn function in perl?
How to convert arrays into a string in perl?
How to read file into hash array ?
What are perl variables?
How to copy a file in perl?
Differentiate between arrays and list in perl.
how to get back up from private character editor which is saved in the format of .udf
Explain which feature of PERL provides code reusability?
In CPAN module, name an instance you use.
You want to concatenate strings with perl. How would you do that?
Why should I use the -w argument with my Perl programs?
Which functions in perl allows you to include a module file. State their differences.