str = "\bNewqaz\b\b\b car!!!\b\b\b."puts str.gsub(/^[\b]+|([^\b](\g<1>)*[\b])/, '').gsub(/[\b]/,'B')
Standard input is empty
New car.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!