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

What are scalars in perl?

1010


What is perl I used for?

1000


Explain the different types of data perl can handle.

943


what is CPAN?

1045


Enlist the advantages of using c over perl?

963


What is “grep” function in perl?

1068


What is the function of cgiwrap in cgi programming?

969


Explain goto expr?

918


Distinguish my and local?

1032


What is warn function in perl?

1017


Explain substr function in perl?

1078


How do I debug a perl program?

1027


Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?

967


What are the different instances used in cgi overhead?

1030


Explain the various characteristics of perl.

1014