From: "Mark J. Reed" Date: 2003-09-16T03:08:11+09:00 Subject: Re: Natural order sort On Monday, September 15, 2003, at 12:07 PM, Alan Davies wrote: > Interesting. I always assumed split filtered out the matching > sections, but it appears that you can make them appear in the > resulting array by putting brackets round the relevant bit in the > regexp. Yup. That's because it was modeled after the split function in Perl, which behaves exactly the same way. Given the relative paucity[1] of Ruby documentation, familiarity with Perl can be a good way to set your behavioral expectations. Of course, if it's something you can test (as opposed to a feature which might or might not occur to you at all), that's the best way to determine the behavior. -Mark [1] I did say "relative". There's just a heckuva lot more info out there about Perl. The Ruby situation is steadily improving, however, and the Pickaxe book is a wondrous thing. :)