I am trying to split a string into tokens based on regex. However the split() gives error saying Illegal Escape Sequencce.
I'm trying to split the following string into tokens.
For example the following string convert into
1+2.0-3.145/4.0
this
1 2.0 3.145 4.0
& this
+ - /
This is the regex I have written but this has some issues and gives error.
String[] tokens = expression.split("\\+\\-\\x\\/");
What am I doing wrong?
EDIT: My end goal is to evaluate a string contaning mathematical expressions & calcualte its results. Is there any library that can be used on Android?