Re: [PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 16:36:36 +0100, Steve Turnbull wrote: > On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote: > >> On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote: >> >>> Steve Turnbull wrote: I am trying to find a regular expression to match a variable, what I think

Re: [PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote: > On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote: > >> Steve Turnbull wrote: >>> I am trying to find a regular expression to match a variable, what I think >>> should work (but doesn't) is; >>> >>> preg_match ('^/[\w],[\w]

RE: [PHP] preg_match help please

2005-09-08 Thread Ford, Mike
On 08 September 2005 09:15, Steve Turnbull wrote: > On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote: > > > Steve Turnbull wrote: > > > I am trying to find a regular expression to match a variable, > > > what I think should work (but doesn't) is; > > > > > > preg_match ('^/[\w],[\

Re: [PHP] preg_match help please

2005-09-08 Thread Jasper Bryant-Greene
Steve Turnbull wrote: On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote: Something like '/^\w+,\w+,\w*$/' maybe? (untested) http://php.net/reference.pcre.pattern.syntax Thats got me a lot further - thanks I reduced it slightly to '/^\w+,\w+,' because at the end there is the

Re: [PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote: > Steve Turnbull wrote: >> I am trying to find a regular expression to match a variable, what I think >> should work (but doesn't) is; >> >> preg_match ('^/[\w],[\w],/', $variable) >> >> The $variable MUST contain an alpha-numeric s

Re: [PHP] preg_match help please

2005-09-08 Thread Jasper Bryant-Greene
Steve Turnbull wrote: I am trying to find a regular expression to match a variable, what I think should work (but doesn't) is; preg_match ('^/[\w],[\w],/', $variable) The $variable MUST contain an alpha-numeric string, followed by a comma, followed by another alpha-numeric string, followed by a

[PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
Hi I am trying to find a regular expression to match a variable, what I think should work (but doesn't) is; preg_match ('^/[\w],[\w],/', $variable) The $variable MUST contain an alpha-numeric string, followed by a comma, followed by another alpha-numeric string, followed by another comma followe

Re: [PHP] preg_match - help please

2005-07-28 Thread André Medeiros
On Thu, 2005-07-28 at 19:45 +0800, Jason Wong wrote: > On Thursday 28 July 2005 01:50, André Medeiros wrote: > > > You can have four words to describe a first and last name... you can > > have other alphabets, like arabian, chinese, etc... inserting accented > > characters alone would make that a

Re: [PHP] preg_match - help please

2005-07-28 Thread Jason Wong
On Thursday 28 July 2005 01:50, André Medeiros wrote: > You can have four words to describe a first and last name... you can > have other alphabets, like arabian, chinese, etc... inserting accented > characters alone would make that a big, nasty regex, let alone > predicting ways you can describe

Re: [PHP] preg_match - help please

2005-07-27 Thread John Nichel
André Medeiros wrote: On Wed, 2005-07-27 at 12:30 -0400, John Nichel wrote: André Medeiros wrote: On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote: André Medeiros wrote: That's not very nice of you, saying that to people who try to help ;) if( strpos( $_POST['frmName'], ' ' ) === f

Re: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 12:30 -0400, John Nichel wrote: > André Medeiros wrote: > > On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote: > > > >>André Medeiros wrote: > >> > >>>That's not very nice of you, saying that to people who try to help ;) > >>> > >>>if( strpos( $_POST['frmName'], ' ' ) ===

Re: [PHP] preg_match - help please

2005-07-27 Thread John Nichel
André Medeiros wrote: On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote: André Medeiros wrote: That's not very nice of you, saying that to people who try to help ;) if( strpos( $_POST['frmName'], ' ' ) === false ) { // Do error handling here } else { // All is OK :) } How does th

Re: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 11:55 -0400, John Nichel wrote: > André Medeiros wrote: > > That's not very nice of you, saying that to people who try to help ;) > > > > if( strpos( $_POST['frmName'], ' ' ) === false ) { > > // Do error handling here > > } else { > > // All is OK :) > > } > > > >

RE: [PHP] preg_match - help please

2005-07-27 Thread Mike Johnson
From: André Medeiros [mailto:[EMAIL PROTECTED] > On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote: > > From: André Medeiros [mailto:[EMAIL PROTECTED] > > > > > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote: > > > > > > > Or even four - like Rafael van der Vaart for example - so > >

Re: [PHP] preg_match - help please

2005-07-27 Thread John Nichel
André Medeiros wrote: That's not very nice of you, saying that to people who try to help ;) if( strpos( $_POST['frmName'], ' ' ) === false ) { // Do error handling here } else { // All is OK :) } How does that match "Firstname Lastname" better than a regex? That will return true as

RE: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote: > From: André Medeiros [mailto:[EMAIL PROTECTED] > > > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote: > > > > > Or even four - like Rafael van der Vaart for example - so > > make sure that the > > > surname box matches spaces as well,

RE: [PHP] preg_match - help please

2005-07-27 Thread Mike Johnson
From: André Medeiros [mailto:[EMAIL PROTECTED] > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote: > > > Or even four - like Rafael van der Vaart for example - so > make sure that the > > surname box matches spaces as well, and special characters > like the ê, as > > well as ' as in John O'K

Re: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote: > "André Medeiros" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote: > > > Hi > > > > > > I want to see that a user is submiting a form field in the correct > manner. > > > S

Re: [PHP] preg_match - help please

2005-07-27 Thread Mark Rees
"André Medeiros" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote: > > Hi > > > > I want to see that a user is submiting a form field in the correct manner. > > So I decided to use preg_match to verify their input. > > > > The pat

Re: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote: > Hi > > I want to see that a user is submiting a form field in the correct manner. > So I decided to use preg_match to verify their input. > > The pattern I am trying to match is; > > Firstname Secondname > > I am not bothered about char

Re: [PHP] preg_match - help please

2005-07-27 Thread André Medeiros
On Wed, 2005-07-27 at 15:27 +0100, Steve Turnbull wrote: > Hi > > I want to see that a user is submiting a form field in the correct manner. > So I decided to use preg_match to verify their input. > > The pattern I am trying to match is; > > Firstname Secondname > > I am not bothered about char

Re: [PHP] preg_match - help please

2005-07-27 Thread John Nichel
Steve Turnbull wrote: Hi I want to see that a user is submiting a form field in the correct manner. So I decided to use preg_match to verify their input. The pattern I am trying to match is; Firstname Secondname I am not bothered about character length just yet (but advise on this would be ap

[PHP] preg_match - help please

2005-07-27 Thread Steve Turnbull
Hi I want to see that a user is submiting a form field in the correct manner. So I decided to use preg_match to verify their input. The pattern I am trying to match is; Firstname Secondname I am not bothered about character length just yet (but advise on this would be appreciated if it can be d