so I am running this in the most recent build of Eclipse. and for some reason, neither me nor my teacher can figure out why this boolean is not changing
String value = null;
boolean matching = false;
String regex = "^[a-zA-Z]$";
Scanner input = new Scanner(System.in);
value = input.next();
if (value.matches(regex))
{
matching = true;
}
else
{
System.out.println("Name is incorrect, please try again");
}
System.out.println(matching);
System.out.println(value);