In my code I want anything that isn't a three (or more) letter word to go into the while loop and anything else to continue into the code. I am not that confident with Regex and would like help on how to fix it.
while (!(word.matches("(a-z){3,}")))
{
System.out.println("You have not entered in a valid word (it has to be at least 3 letters long).");
System.out.println();
System.out.print("Please enter a word of your choice: ");
word = keyboard.nextLine();
}
N.B. This is for homework