I can not check the banal expression. Result Not matched!
What is missing in this code?
public static void main(String[] args) { doMatch("abc"); } public static void doMatch(String value){ Pattern pattern = Pattern.compile("[a-zA-Z]"); Matcher matcher = pattern.matcher(value); if(matcher.matches()){ System.out.println(value + " Matched!"+" "+ matcher.matches()); } else if(!(matcher.matches())){ System.out.println(value + " :Not matched!"+" "+ matcher.matches()); } }