Hi!

I couldn't understand the behavior of this code:

match =  'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/)
a = match.to_a
puts a.size                #  2
puts a.join(",")           #  Feb 23rd,rd
puts a[0]                   #  Feb 23rd
puts a[1]                   #  rd

In my understanding, /Feb 23(rd)?/ is equivalent to /Feb 23|Feb
23rd/ . So, match should not include 'rd'.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to