On 8 Oct 2004 17:27:10 -0000, Tim Van Wassenhove <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>, Greg Donald wrote:
> > On Fri, 8 Oct 2004 11:38:23 -0500, Brent Clements
> ><[EMAIL PROTECTED]> wrote:
> >> Given the following string:
> >>
> >> $textString = "Share A Dream Come True Parade 3:00 SpectroMagic Parade 9:00, 
> >> 11:00 Wishes? nighttime spectacular 10:00"
> >>
> >> I need to break the string up into pieces where as
> >>
> >> $string[1] = "Share A Dream Come True Parade 3:00"
> >> $string[2] = "SpectroMagic Parade 9:00, 11:00"
> >> $string[3] = "Wishes? nighttime spectacular 10:00"
> >
> > preg_match_all() is what you want to use.  You can easily match
> > everything up to the time since it's formed with a ":00" at the end
> > each time.
> 
> If i'm not mistaken, preg_split on \d{0,2}:\d{2}
> 

You may want to add a \s+ to the end of that, in the event that there
is more than one time associated with the string, as in $string[2]. 
If you can count on the last 2 digits of the time followed by a space
determining your separator (and a comma means keep going), it should
work for you.

My best guess: /([\w\s]+[\d{1,2}:\d{2},*]+\s+)/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to