Re: regular expression for time

From: Date: Mon, 29 Aug 2005 14:29:48 +0000
Subject: Re: regular expression for time
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-221508@lists.php.net to get a copy of this message
Hello babu, Monday, August 29, 2005, 6:50:32 AM, you wrote: > how can i write regular expression for time in 24-hour format i:e, > HH:MM:SS. using preg_match. <?php $xtime="19:59:53"; if (preg_match("/([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]/", $xtime)) echo "Good"; else echo "Bad"; ?> -- TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B __ ____ ____ ____ Geocaching: http://gps.PCWize.com ( ) ( ___)(_ _)( ___) TBUDP Wiki Site: http://www.PCWize.com/thebat/tbudp )(__ )__) _)(_ )__) Roguemoticons & Smileys: http://PCWize.com/thebat (____)(____)(____)(__) PHP Tutorials and snippets: http://www.DevTek.org Save your pennies. The dollars go to the I.R.S.

« previous php.general (#221508) next »