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

Re: [PHP] Preg_match----------help

2005-01-22 Thread RaTT
Hello, This regular expresion should help you on your way $regex = "/<[A-z_\-]+>?/"; HTH Jarratt On Sat, 22 Jan 2005 17:03:30 +0600, Chandana Bandara <[EMAIL PROTECTED]> wrote: > hi , > > using preg_match , how can i match "<", "_" , ">" " - " such special > characters in a sentence ??? >

[PHP] Preg_match----------help

2005-01-22 Thread Chandana Bandara
hi , using preg_match , how can i match "<", "_" , ">" " - " such special characters in a sentence ??? Eg: Strings are like this, 1.Ahgrwgsgd dfjb yuhh dfh GHJGJ kjHGKJGK -- here i want to match 3.GHHTGH GHJK

Re: [PHP] preg_match help?

2002-08-17 Thread Jason Wong
On Sunday 18 August 2002 08:29, vic wrote: > Ok, since I've been trying to get this working forever, how wold you get > something like this working I need, to get everything between these 2 > tags: > > and > > Someone gave me this code: > > preg_match('!]+>(.*)!Uis',$str,$regs); > > with the ! i

RE: [PHP] preg_match help?

2002-08-17 Thread vic
urday, August 17, 2002 8:30 PM To: [EMAIL PROTECTED]; 'Jason Soza'; 'PHP-General' Subject: RE: [PHP] preg_match help? Ok, since I've been trying to get this working forever, how wold you get something like this working I need, to get everything between these 2 tags: a

RE: [PHP] preg_match help?

2002-08-17 Thread vic
---Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 17, 2002 6:49 PM To: Jason Soza; PHP-General Subject: Re: [PHP] preg_match help? preg_match("/.*]+>(.*).*/", $contents,$story); echo $story[1]; preg_match always return a array. The first eleme

Re: [PHP] preg_match help?

2002-08-17 Thread Bas Jobsen
preg_match("/.*]+>(.*).*/", $contents,$story); echo $story[1]; preg_match always return a array. The first element ($array[0])contains your complete regexp. The next ($array[1])one the first match between () etc. Don't use ! but / Op zondag 18 augustus 2002 01:27, schreef Jason Soza: > I se

[PHP] preg_match help?

2002-08-17 Thread Jason Soza
I seriously need some help trying to make a match here. Obligatory disclaimer: yes, I've searched google.com, I've read the PHP manual section on preg_match(), and I've sat here for 3 hours trying to resolve this on my own. :) Any help would be great: I need to match everything between: $headlin