In this program I'm parsing input into integers and I can't seem to be able to take in negative numbers and have tried a bunch of regular expressions. I can get positive integers no problem by removing the &&^- it's just the negative integers I'm having problems with.
input = console.readLine("?> ").split("\\D+&&^-");
Any idea and what I'm doing wrong? Thanks for any help in advance.
Sample input: -7 * 4
Output: -7 and 4 should be stored into an array of strings.