Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain returning values from subroutines?

1003


What are different data types that perl supports. Elaborate on them.

1177


Define operators used in perl?

982


What is -> symbol in perl?

1058


What is the syntax used in Perl grep function?

1080


What are the functions that can be performed using cgi program?

977


What are the purpose of close(), getc() and read() functions?

925


What is automatic error handling in perl?

1116


Explain regular expression in perl?

1018


Why we use CGI?

2593


what is Polymorphism in Perl?

1018


What is hash?

1152


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

998


Write a cgi program to show the header part?

1044


Explain different types of perl operators.

993