开满天机
像这样简单:0{7,}|1{7,}public static void main (String args[]) { String zeros = "0000000"; String ones = "1111111"; String eights = "8888888"; String shuffle = "6516516"; System.out.println(zeros.matches("0{7,}|1{7,}")); // true System.out.println(ones.matches("0{7,}|1{7,}")); // true System.out.println(eights.matches("0{7,}|1{7,}")); // false System.out.println(shuffle.matches("0{7,}|1{7,}")); // false}