$_ = '123 4(5)67 89';s/(?=[() ])/\\/g;print;
Standard input is empty
123\ 4\(5\)67\ 89
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!