radhika wrote:
Hi,

Hello,

I need to parse this string: 2005-03-11 13:49:41.19
to just get the hour and minute.

my program has:

if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
{
   print("Hour:Minute = $4:$5\n");
}

This is breaking. If anyone can refine this, that would be great.
thanks,

if( $string =~ /\d{4}-\d\d-\d\d (\d\d:\d\d):\d\d/ ) { print "Hour:Minute = $1\n"; }




John -- use Perl; program fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to