hi, i have expressions like :
-3-5
or -3--5
or 3-5
or 3-+5
or -3-+5
I need to extact the numbers , splitting on the "-" sign between them i.e in the above cases i would need, -3 and 5, -3 and -5 , 3 and 5, 3 and +5 , -3 and +5. I have tried using this:
String s[] = str.split("[+-]?\\d+\\-[+-]?\\d+");
int len = s.length;
for(int i=0;i<len;i++)System.out.println(s[i]);
but it's not working