[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Marcelino Debajo
thanks Fred. I think I misunderstood something. On Mon, Oct 20, 2008 at 12:14 AM, Frederick Cheung <[EMAIL PROTECTED]> wrote: > > > On 19 Oct 2008, at 16:04, Marcelino Debajo wrote: > >> >> Yeah you're right, >> >>> match = 'Today is Feb

[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Marcelino Debajo
Yeah you're right, > match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)??/) > match[0] #=> "Feb 23" > match[1] #=> nil I expected: > match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/) # ? is greedy here > match[0] #=> "Feb 23rd" > match[1] #=> nil But what I got in ruby 1.8.6 (2007-09