s = 'one two three four\ five'puts s.split(/(?<!\\)\s+/)puts "------"puts s.scan(/(?:[^\\\s]|\\.)+/)
Standard input is empty
one two three four\ five ------ one two three four\ five
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!