public boolean judge(String s){ String str="^[0-9]6$" Pattern pattern=Pattern.compile(str); Matcher matcher=pattern.matcher(s).matcher(); }