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 grooving and shortening of arrays?

1090


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

936


what is CPAN?

1000


What are the options that can be used to avoid logic errors in perl?

958


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

1020


How to determine strings length in perl?

970


what is Perl one liner?

903


What is posix in perl?

947


How to turn on Perl warnings? Why is that important?

1072


What are the logical operators used for small scale operations? Explain them briefly.

990


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

1016


Why we use CGI?

2542


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

2298


Explain the difference between "my" and "local" variable scope declarations. ?

1075


What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?

1024