Three problems here:
String.matches()
- if the API is there, use itI recommend you use code like this:
public boolean matches(String regex) {
regex = "^.*" + regex + ".*$"; // pad with regex to allow partial matching
System.out.println("abcABC ".matches(regex));
return "abcABC ".matches(regex);
}
public static void main(String[] args) {
HowEasy words = new HowEasy();
words.matches("[a-zA-Z]+"); // added "+" (ie 1-to-n of) to character class
}