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
What exactly is grooving and shortening of the array?
what is Polymorphism in Perl?
How do I print the entire contents of an array with Perl?
Write a program to decode the data in the form using cgi programming
Which feature of perl provides code reusability?
You want to print the contents of an entire array. How would you do that?
Difference between the variables in which chomp function work ?
Explain subroutine?
You want to empty an array. How would you do that?
What is a chomp() function in perl?
Explain the internal working of cgi
Define print() function in perl?
List the prefix dereferencer in Perl.
Why do we use "use strict" in perl?
Explain lexical variables.