//Sample18_25.java class Sample18_25{ public static void main(String[] args){ String regex = ".*abc.*"; System.out.println("NOT " + regex); System.out.println("----------"); String[] strs = { "abcdefg", "ababcdefg", "dxxfgabc", "yxabzcdxf" }; boolean boo; for(String str : strs){ boo = !str.matches(regex); System.out.println(str + "\t" + boo); } } }