I know there is a lot out there.. But I couldn't figure out how to extract two parameters from Scanner(System.in);
commandline = scanner.readLine();
Two parameters are allowed:
First one can be one of AHG or the digits between 4 to 9.
The second parameters again between 4 to 9 OR any number.
It should handle all the scenarios:
" A 3 " //spaces before and after
"A 3" // spaces between the params
"A 7 6" // Unwanted 3rd parameter
" 6 " // Only one param with spaces.
So how to write Regex for this to extract the above?
I tried this one. \\w\\s. But this did not work. I am poor with RegEx.