s = '{{something|a}} text text {{another|one|with|more|items}}' p s.scan(/{{(.*?)}}/).flatten.map{ |x| x.split("|") }