i need a regular expression that would replace arithmetic operators in a given string. I need to be able to replace the operators with "|".
for instance,
String input = "5.0+9.0-(-2.0)";
String replace = input.replaceAll("[+-//*&&[^.]&&[^(-]]", "|");
in this instance i intend only to replace the operators outside the brackets. I think the regular expression has to be modified more to read only the "-" outside the brackets but i'm ought of ideas.