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
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]
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
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
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
No luck on any of those suggestions people but thanks anyway :(
I had a feeling it was a bit too complex for a regexp.
> Oh, I didnt read the bit at the bottom about the times appearing any
> number of times. Off the top of my head I think this should work...
>
> PREG:
>
> "/'([a-z]+)-([a-z]+
Oh, I didnt read the bit at the bottom about the times appearing any number
of times. Off the top of my head I think this should work...
PREG:
"/'([a-z]+)-([a-z]+)\s(?:([0-9]+(?::[0-9]+|))(?:,\s)?)*'/"
--
Matt
- Original Message -
From: "Cameron Just" <[EMAIL PROTECTED]>
To: <[EMAIL P
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
8 matches
Mail list logo