Re: Regular Expression

From: Date: Thu, 05 Aug 2004 02:22:19 +0000
Subject: Re: Regular Expression
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35580@lists.php.net to get a copy of this message
Ng Hwee Hwee wrote:
Hi all, I somehow just couldn't get my regular expression syntax correct. Will you please help me? some examples of my valid string is: sinx0401-001-45 hkgx0403-020-12 jktx0402-000-01 bkkx0407-013-44 the definition is: 1st 4 characters - can only be "sinx" or "hkgx" or "bkkx" or "jktx" next 4 characters - numbers 0 to 9 next 1 character - a dash "-" next 3 characters - numbers 0 to 9 next 1 character - a dash "-" last 2 characters - numbers 0 to 9
(sin|hkg|bkk|jkt)x[0-9]{4}-[0-9]{3}-[0-9]{2} -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com

« previous php.db (#35580) next »