On May 26, 2005, at 3:55 PM, Oliver Cromm wrote:

> I just stumbled over the following effect and (trial-and error)
> workaround:
>
> p "abcxyxyxydef".split(/(xy)+/)    #=> ["abc","xy","def"]
> p "abcxyxyxydef".split(/(?:xy)+/)  #=> ["abc","def"]
>
> Why this difference?

A capture in a split() Regexp is taken to indicate pieces of the  
separator you would like returned in the resulting set.

Hope that helps.

James Edward Gray II