gsterndale
7/23/2008 6:51:00 AM
On Jul 23, 1:55 am, Heesob Park <pha...@gmail.com> wrote:
> Hi,
>
> 2008/7/23 gsterndale <gsternd...@gmail.com>:> In the example below I'd like to match 'what is' and 'foo bar'. Any
> > ideas?
>
> > 'what is foo bar' =~ /(.*)\s*(foo bar|bar)/ => 0
> > $1 => "what is foo "
> > $2 => "bar"
>
> > Thanks!
>
> Try this:
>
> 'what is foo bar' =~ /(.*?)\s+(foo bar|bar)/
>
> Regards,
>
> Park Heesob
Good stuff. Thanks Park!