From: Giampiero Zanchi Date: 2009-02-11T20:00:34+09:00 Subject: Re: Method to get string combinations ciao I'm a beginner... this code produces a partial result; try to improve and finalize it my_text = "This {is|was} a {good|nice} day" r = /\{(.*?)\}/ elem = my_text.split(r) elem.map! {|x| x.split("|")} p elem output: [["This "], ["is", "was"], [" a "], ["good", "nice"], [" day"]] curious to see the complete solution -- Posted via http://www.ruby-forum.com/.