fork download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. class Ideone {
  5.  
  6. public static void main(String[] args) {
  7. String text = "asd oOsdwe ertyu ghjLK Ewesldk";
  8. String substrings[] = text.split(" ");
  9. for (String word : substrings) {
  10. String regex = "[AaOrK]";
  11. Pattern p = Pattern.compile(regex);
  12. Matcher m = p.matcher(word);
  13. boolean res = m.find();
  14. if (res == false) {
  15. System.out.print(" returns: " + word + " " + res);
  16. }
  17. }
  18. }
  19. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
       returns: Ewesldk  false