I have a String:
String str = "(25, 4) (1, -6)";
I want to get the individual numbers. For now, this is what I am doing:
String[] strNew = str.replaceAll("\\s+","").split("-?\\D+");
But below is what i get:
25
4
1
6
I can't seem to get the negative on the 6. I have search on here from answers but none of the regex I found worked. Any thoughts?