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

Can inheritance be used in perl? Explain with the help of an example.

901


What does `$result = f() .. g()' really return?

1076


How can the user execute a long command repeatedly without typing it again and again?

857


What is warn function in perl?

885


How to convert arrays into a string in perl?

883


How to read file into hash array ?

1009


What are perl variables?

871


How to copy a file in perl?

910


Differentiate between arrays and list in perl.

945


how to get back up from private character editor which is saved in the format of .udf

2241


Explain which feature of PERL provides code reusability?

1150


In CPAN module, name an instance you use.

905


You want to concatenate strings with perl. How would you do that?

818


Why should I use the -w argument with my Perl programs?

911


Which functions in perl allows you to include a module file. State their differences.

896