[PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) I tested it with 0-9 and my regexp catches every

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Greg Wiley
- Original Message - From: [EMAIL PROTECTED] I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI])

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Marek Kilimajer
Not an answer but '/^[[:alpha:]]{1,1}$/' could be writen as '/^[[:alpha:]]$/' [EMAIL PROTECTED] wrote: I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if (!empty($_POST[MI])

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) I tested it with 0-9

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI])

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]): * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a 0 (zero) as a middle initial! My regexp is: if

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
Thank you. I did the following: if (isset($_POST[MI]) (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) and zero is caught. On Fri, 15 Aug 2003, CPT John W. Holmes wrote: From: [EMAIL PROTECTED] I use preg_match to validate the Middle Initial field of a form and so far it works,

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
I believe I spoke too soon. If I use isset() then even if I leave the field empty it still returns true. I am trying to view the documentation for this function but php.net seems to be timing out now. On Fri, 15 Aug 2003 [EMAIL PROTECTED] wrote: Thank you. I did the following: if

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): I believe I spoke too soon. If I use isset() then even if I leave the field empty it still returns true. I am trying to view the documentation for this function but php.net seems to be timing out now. if (isset($_POST[MI])