I need a regular expression that will match 0-9, (,),+,-,* and /.
0
9
(
)
+
-
*
/
If you need a regex to match an arithmetic expression like this: 3+2-24*2/2-1 you can try this:
String reg1="([0-9]+[\\+\\-\\*\\/]{1}[0-9]+)+([\\+\\-\\*\\/]{1}[0-9]+)*";
You can add the bracket where do you want if you'll edit this regex.