console.log( '10 - 89 - 90'.replace(/(\d) - (\d)/g, "$1-$2"));
Standard input is empty
10-89-90
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!