thanx!!! it worked like a charm! =)

just a question, i've tried adding a ^ to the front of your expressions and
a $ to the end of your expression and it still worked.. but is it
recommended? why didn't you use them?

^(sin|hkg|bkk|jkt)x[0-9]{4}-[0-9]{3}-[0-9]{2}$

hwee

----- Original Message ----- 
From: "John Holmes" <[EMAIL PROTECTED]>
To: "Ng Hwee Hwee" <[EMAIL PROTECTED]>
Cc: "PHP DB List" <[EMAIL PROTECTED]>
Sent: Thursday, August 05, 2004 10:22 AM
Subject: Re: [PHP-DB] Regular Expression


> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to