On Tue, 27 Jan 2004, Madhu Reddy wrote: > Hi, > I need some help on regular expression... > i have following in variable $total_count > > $total_count = "##I USBP 000001 10:38:09(000) > <xyz_abc_etrack_validation,6> ETRACK_TOTAL_RECS : 100" > > Here in this ETRACK_TOTAL_RECS is fixed and common for > all and rest is changing... > > like following > > $total_count = "##I USBP 000002 12:38:09(000) > <abc_gkkh_uiu,8> ETRACK_TOTAL_RECS : 500" > > > here i need some regular expression to get, 100 like > following > > $total_count = 100 > > I appreciate u r help.. > > Thanks > -Madhu
>From your examples, it appears that the number you want is always at the end of the line. The simpliest, but not necessarily the best way to do this might be: ($total_count) = ($total_count =~ /(\d+)$/); Basically, this says: Match all the digits before the end of the line. -- Maranatha! John McKown -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>