I have this small piece of code
String[] words = {\"{apf\",\"hum_\",\"dkoe\",\"12f\"}; for(String s:words) { if(s.matches(\"[a-z]\")) { Syste
you must put at least a capture () in the pattern to match, and correct pattern like this:
()
String[] words = {"{apf","hum_","dkoe","12f"}; for(String s:words) { if(s.matches("(^[a-z]+$)")) { System.out.println(s); } }