From: Pavel Smerk Date: 2006-08-03T04:05:14+09:00 Subject: Re: How to split(//) with respect to bigraphs? Paul Battley wrote: > On 02/08/06, Justin Collins wrote: > >> irb(main):001:0> "czech".split(/([Cc][Hh])|/) >> => ["c", "z", "e", "ch"] >> irb(main):002:0> "check czech".split(/([Cc][Hh])|/) >> => ["", "ch", "e", "c", "k", " ", "c", "z", "e", "ch"] >> irb(main):003:0> "cHeck czeCh".split(/([Cc][Hh])|/) >> => ["", "cH", "e", "c", "k", " ", "c", "z", "e", "Ch"] > > > Or use scan: > > str.scan(/(?:ch)|./i) Yes, the use of scan strikes me in the meantime too. Why (?:)? str.scan(/ch|./i) does exactly the same, doesn't it? Thank you, P.