So basically I'm trying to convert this string: "(1+2) / 2" to this "( 1 + 2 ) / 2". And I've tried this:
String inputInfix = input.replaceAll("[^0-9/]", " [^0-9/] ");
But it doesn't work, is there some way to replace every character except "/" and the digits with a space on either side. For example, "(1 / 2)" -> " ( 1 / 2 )"