From: Morton Goldberg Date: 2006-08-03T08:28:22+09:00 Subject: Re: How to split(//) with respect to bigraphs? On Aug 2, 2006, at 3:05 PM, Pavel Smerk wrote: > But where can one find this feature of the split in the > documentation? http://www.rubycentral.com/ref/ > ref_c_string.html#split does not mention split returns not only > delimited substrings, but also successful groups from the match of > the regexp. In Dave Thomas' Pickaxe book. Under String#split he writes: "If pattern is a Regexp, str is divided where the pattern matches. Whenever the pattern matches a zero-length string, str is split into individual characters. If pattern includes groups, these groups will be included in the returned values." Then he gives the following example: "a@1bb@2ccc".split(/@(\d)/) => ["a", "1", "bb", "2", "ccc"] Regards, Morton