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 is the use of -w, -t and strict in Perl?

982


What does delete function do in perl?

974


When do you use perl programming?

989


Differentiate use and require?

937


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

874


Create a function that is only available inside the scope where it is defined ?

985


How can you replace the characters from a string and save the number of replacements?

891


Explain which feature of PERL provides code reusability?

1203


What are perl variables?

918


What is stdin in perl?

959


How to implement a stack in Perl?

1011


how to connect cisco switch uisng perl script

3841


Explain string comparison operators in perl.

1006


what are the strategies followed for multiple form interaction in cgi programs?

939


What is -> symbol in perl?

1005