请大家帮忙写个正则表达式。。。 位数必须在6至14之间,并且其中不能整体包含一个已知的字符串"text". 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 简单的说 就是密码中不允许包括与用户名相同的字符串,如用户名是“user”,则密码中就不能包括“user” String str = "??"; if (str.length() >= 6 && str.length() <= 14) { if (str.matches(".*test.*")) { System.out.println("false"); } else { System.out.println("true"); } }else{ System.out.println("false"); } public static boolean patternTest(String s){ return s.matches(".{6,14}")&& s.matches(".*test.*"); } 求救:Swing中setLayout(null)不能显示组件 关于容器、hashmap的一个问题 高分请教! 高分求教RMI调用时多线程问题?急急急!来者有分! 如何从Graphics 中获取一个坐标点上的颜色 switch case 问题,在线等~~!@ 怎么样设置classpath java中方法里的变量系统何时回收内存空间? 招聘大型论坛斑竹,送高分 请问,能否创建一个抽象类的实例?一定给分!!! 关于DataInputStream类中基本数据读写流的问题 怎么判断用户输入了多少个字符或者多少个数字? 怎么不字符串的内容作为另外一个类的引用
String str = "??"; if (str.length() >= 6 && str.length() <= 14) {
if (str.matches(".*test.*")) {
System.out.println("false");
} else {
System.out.println("true");
}
}else{
System.out.println("false");
}
public static boolean patternTest(String s){
return s.matches(".{6,14}")&& s.matches(".*test.*");
}