puts "a-b-c-d".scan(/(?=(\w-\w))/).flatten.inspect
Standard input is empty
["a-b", "b-c", "c-d"]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!