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 are scalars in perl?
What is perl I used for?
Explain the different types of data perl can handle.
what is CPAN?
Enlist the advantages of using c over perl?
What is “grep” function in perl?
What is the function of cgiwrap in cgi programming?
Explain goto expr?
Distinguish my and local?
What is warn function in perl?
Explain substr function in perl?
How do I debug a perl program?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
What are the different instances used in cgi overhead?
Explain the various characteristics of perl.