public class RegTest {
public static void main(String[] args) {
//TODO自动生成的方法存根
String s="tutorials";
boolean i=s.matches("^((?!kk).)*$");
System.out.println(i);
}
returns true, if word does not match character kk
}