From: craig duncan Date: 2000-12-21T05:06:44+09:00 Subject: [ruby-talk:7790] Re: Regex array subscripts I'm just a Ruby-nuby and sparse documentation has me trying to construct my own (deeper) explanations for why things work the way they do. wrt: "one 123 two"[/\d+/] => "123" even more simply we have: "one 123 two"['e 1'] => "e 1" So, what is confusing is when the documentation says: "Arrays are ordered, integer-indexed collections of any object." It appears that an integer index is only one way of accessing array elements. Which is what had me confused, because i was led to think that /\d/ and /\d+/ both return an (the same) integer. But apparently they return the matched string, which works just fine as an array index. Wierd.