I want to recognize integers or decimals and the four simple operations, broken into tokens I can\'t get the decimal to work, can you please help?
My reg is
It may works for you:
expression = "2.7 + 3 * (1 + 2)"; String expRegString = "\\d+(\\.\\d+)*|\\(\\d+(\\.\\d+)*[\\+\\-\\*\\/]\\d+(\\.\\d+)*\\)";