Im trying to figure out how to validate the users input.I want the user to input something like a1 or B6.The input should be in the following pattern. letter from a to h followed by a number from 1 to 8, [String-number].Also the letter should be accepted either if it is capital either not.Here is my code.Any help is very much appreciated!
private void getUserInput() {
Scanner scan = new Scanner(System.in);
userGuess1 = scan.nextLine();
// Here i should validate if the input is in the right format
userGuess = userGuess1;