Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Matt Moreton
Very nice. I was going to suggest: But uhhh, your way is much nicer :] - Original Message - From: "Richard Archer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 4:04 AM Subject: Re: [PHP] Regular Expression Challenge > At 11:30

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Richard Archer
At 11:30 AM +1000 26/3/02, Cameron Just wrote: >I was not sure as to whether regexp could do recursive matching and now I >know. This is crazy! There used to be clue on this list! \n"; } } ?> Output: $tok[0] = wed $tok[1] = thurs $tok[2] = 9:35 $tok[3] = 14:56 $tok[4] = 18:35 $tok[5]

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Matt Moreton
Sent: Tuesday, March 26, 2002 1:01 AM Subject: Re: [PHP] Regular Expression Challenge > You won't be able to do that with a regexp alone. Recursively matching > isn't possible. You'll need a little help from some additional code. > > $string = "wed-thurs 9:3

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Cameron Just
Brilliant. (Sort of) Thats the answer I needed thankyou. I was not sure as to whether regexp could do recursive matching and now I know. Thankyou for your help. > You won't be able to do that with a regexp alone. Recursively matching > isn't possible. You'll need a little help from some addit

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Christopher William Wesley
You won't be able to do that with a regexp alone. Recursively matching isn't possible. You'll need a little help from some additional code. \n" . $matches[2] . "\n" ); while( list( $key, $val ) = each( $times ) ){ print( trim( ${val} ) . "\n" ); } ?> That seems

Re: [PHP] Regular Expression Challenge

2002-03-25 Thread Cameron Just
"/'([a-z]+)-([a-z]+)\s(?:([0-9]+(?::[0-9]+|))(?:,\s)?)*'/" > > -- > Matt > > - Original Message - > From: "Cameron Just" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, March 25, 2002 6:15 AM > Subject: [P

Re: [PHP] Regular Expression Challenge

2002-03-24 Thread Matt Moreton
lt;[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 25, 2002 6:15 AM Subject: [PHP] Regular Expression Challenge > Hi, > > I am trying to pull out the following information via a regular expression. > > The string I am searching on is 'wed-thurs 9:35, 14

[PHP] Regular Expression Challenge

2002-03-24 Thread Matt Moreton
From: "Cameron Just" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 25, 2002 6:15 AM Subject: [PHP] Regular Expression Challenge > Hi, > > I am trying to pull out the following information via a regular > expression. > > The string I am searchi

Re: [PHP] Regular Expression Challenge

2002-03-24 Thread Thalis A. Kalfigopoulos
Why a regexpr? Do one explode() on the " " Clean up the commas from the elements [1],[2] & [3] of the returned array and on element[0] do an additional explode on "-" cheers, --t. On Mon, 25 Mar 2002, Cameron Just wrote: > Hi, > > I am trying to pull out the following information via a regula

[PHP] Regular Expression Challenge

2002-03-24 Thread Cameron Just
Hi, I am trying to pull out the following information via a regular expression. The string I am searching on is 'wed-thurs 9:35, 14:56, 18:35' and I want it to retreive wed thurs 9:35 14:56 18:35 The regular expression I am using is ([a-z]+)-([a-z]+) +([0-9]{1,2}:?[0-9]{0,2})[, ]* It seems to