Scanner s=new Scanner(System.in)def x=s.nextLine()def n=s.nextInt()x=x.replaceAll(/\d+/,{it->it.toInteger()*n})println x
This 1 is22a 3352sentence 50 3
This 3 is66a 10056sentence 150
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!